
cherokee at cherokee-project
Nov 16, 2009, 5:08 AM
Post #1 of 1
(65 views)
Permalink
|
|
[3826] cherokee/trunk/cherokee: The error conversion continues: Replaces PRINT_* by LOG_*.
|
|
Revision: 3826 http://svn.cherokee-project.com/changeset/3826 Author: alo Date: 2009-11-16 14:08:30 +0100 (Mon, 16 Nov 2009) Log Message: ----------- The error conversion continues: Replaces PRINT_* by LOG_*. Modified Paths: -------------- cherokee/trunk/cherokee/error_list.py cherokee/trunk/cherokee/errors.py cherokee/trunk/cherokee/logger_writer.c cherokee/trunk/cherokee/validator_authlist.c cherokee/trunk/cherokee/validator_ldap.c Modified: cherokee/trunk/cherokee/error_list.py =================================================================== --- cherokee/trunk/cherokee/error_list.py 2009-11-16 11:16:18 UTC (rev 3825) +++ cherokee/trunk/cherokee/error_list.py 2009-11-16 13:08:30 UTC (rev 3826) @@ -67,6 +67,21 @@ desc = "For some reason, Cherokee could not resolve the hostname.") +# cherokee/validator_authlist.c +# +e('VALIDATOR_AUTHLIST_USER', + title = "Could not read 'user' value for '%s'", + desc = BROKEN_CONFIG) + +e('VALIDATOR_AUTHLIST_PASSWORD', + title = "Couldn't read 'password' value for '%s'", + desc = BROKEN_CONFIG) + +e('VALIDATOR_AUTHLIST_EMPTY', + title = "Empty authlist: Access will be denied.", + desc = "The access to this resource will be denied as long as the list of allowed users is empty.") + + # cherokee/validator_pam.c # e('VALIDATOR_PAM_DELAY', @@ -84,6 +99,10 @@ # cherokee/validator_ldap.c # +e('VALIDATOR_LDAP_KEY', + title = "Validator LDAP: Unknown key: '%s'", + desc = BROKEN_CONFIG) + e('VALIDATOR_LDAP_PROPERTY', title = "The LDAP validation module requires a '%s' property", desc = "It looks like you did not fill a required property. Check the LDAP details and try again.") @@ -333,7 +352,35 @@ title = "Logger: No '%s' log has been defined.", desc = BROKEN_CONFIG) +e('LOGGER_NO_WRITER', + title = "Logger writer type is required.", + desc = BROKEN_CONFIG) +e('LOGGER_WRITER_UNKNOWN', + title = "Unknown logger writer type '%s'", + desc = BROKEN_CONFIG) + +e('LOGGER_WRITER_READ', + title = "Logger writer (%s): Couldn't read the filename.", + desc = BROKEN_CONFIG) + +e('LOGGER_WRITER_APPEND', + title = "Could not open '%s' for appending", + desc = SYSTEM_ISSUE) + +e('LOGGER_WRITER_ALLOC', + title = "Allocation logger->max_bufsize %d failed.", + desc = "The system might have run out of memory.") + +e('LOGGER_WRITER_PIPE', + title = "Could not create pipe (errno=%d): ${errno}", + desc = SYSTEM_ISSUE) + +e('LOGGER_WRITER_FORK', + title = "Could not fork (errno=%d): ${errno}", + desc = SYSTEM_ISSUE) + + # cherokee/logger_custom.c # e('LOGGER_CUSTOM_NO_TEMPLATE', Modified: cherokee/trunk/cherokee/errors.py =================================================================== --- cherokee/trunk/cherokee/errors.py 2009-11-16 11:16:18 UTC (rev 3825) +++ cherokee/trunk/cherokee/errors.py 2009-11-16 13:08:30 UTC (rev 3826) @@ -144,7 +144,7 @@ source_num = source_errors_params[error.id] known_num = known_errors_params[error.id] if source_num != known_num: - print >> sys.stderr, "ERROR: Parameter number mismatch: %s (source %d, definition %d)" % (error.id, source_errors_params[error.id], known_errors_params[error.id]) + print >> sys.stderr, "ERROR: Parameter number mismatch: %s (source %d, definition %d)" % (error.id, source_num, known_num) error_found = True return error_found Modified: cherokee/trunk/cherokee/logger_writer.c =================================================================== --- cherokee/trunk/cherokee/logger_writer.c 2009-11-16 11:16:18 UTC (rev 3825) +++ cherokee/trunk/cherokee/logger_writer.c 2009-11-16 13:08:30 UTC (rev 3826) @@ -119,7 +119,7 @@ ret = cherokee_config_node_read (config, "type", &tmp); if (ret != ret_ok) { - PRINT_MSG_S ("Logger writer type is needed\n"); + LOG_ERROR_S (CHEROKEE_ERROR_LOGGER_NO_WRITER); return ret_error; } @@ -132,7 +132,7 @@ } else if (equal_buf_str (tmp, "exec")) { *type = cherokee_logger_writer_pipe; } else { - PRINT_MSG ("Unknown logger writer type '%s'\n", tmp->buf); + LOG_CRITICAL (CHEROKEE_ERROR_LOGGER_WRITER_UNKNOWN, tmp->buf); return ret_error; } @@ -159,7 +159,7 @@ case cherokee_logger_writer_file: ret = cherokee_config_node_read (config, "filename", &tmp); if (ret != ret_ok) { - PRINT_MSG_S ("Logger writer (file): Couldn't read the filename\n"); + LOG_ERROR (CHEROKEE_ERROR_LOGGER_WRITER_READ, "file"); return ret_error; } cherokee_buffer_add_buffer (&writer->filename, tmp); @@ -168,7 +168,7 @@ case cherokee_logger_writer_pipe: ret = cherokee_config_node_read (config, "command", &tmp); if (ret != ret_ok) { - PRINT_MSG_S ("Logger writer (exec): Couldn't read the command\n"); + LOG_ERROR (CHEROKEE_ERROR_LOGGER_WRITER_READ, "exec"); return ret_error; } cherokee_buffer_add_buffer (&writer->command, tmp); @@ -193,8 +193,7 @@ ret = cherokee_buffer_ensure_size (&writer->buffer, buf_len); if (ret != ret_ok) { - PRINT_ERROR ("Allocation logger->max_bufsize " FMT_SIZE " failed !\n", - (CST_SIZE) writer->max_bufsize); + LOG_ERROR (CHEROKEE_ERROR_LOGGER_WRITER_ALLOC, writer->max_bufsize); return ret_nomem; } @@ -214,7 +213,7 @@ pid_t pid; if (pipe (to_log_fds)) { - PRINT_ERROR ("Pipe error: errno=%d", errno); + LOG_ERRNO (errno, cherokee_err_error, CHEROKEE_ERROR_LOGGER_WRITER_PIPE, errno); return ret_error; } @@ -235,7 +234,7 @@ SHOULDNT_HAPPEN; case -1: - PRINT_ERROR ("Fork failed, errno=%d", errno); + LOG_ERRNO (errno, cherokee_err_error, CHEROKEE_ERROR_LOGGER_WRITER_FORK, errno); break; default: @@ -274,7 +273,7 @@ case cherokee_logger_writer_file: writer->fd = open (writer->filename.buf, O_APPEND | O_WRONLY | O_CREAT | O_LARGEFILE | O_NOFOLLOW, 0640); if (writer->fd == -1) { - PRINT_MSG ("Couldn't open '%s' for appending\n", writer->filename.buf); + LOG_ERROR (CHEROKEE_ERROR_LOGGER_WRITER_APPEND, writer->filename.buf); ret = ret_error; goto error; } Modified: cherokee/trunk/cherokee/validator_authlist.c =================================================================== --- cherokee/trunk/cherokee/validator_authlist.c 2009-11-16 11:16:18 UTC (rev 3825) +++ cherokee/trunk/cherokee/validator_authlist.c 2009-11-16 13:08:30 UTC (rev 3826) @@ -100,16 +100,16 @@ ret = cherokee_config_node_read (conf, "user", &tmp); if (ret != ret_ok) { - PRINT_MSG ("Couldn't read 'user' value for %s\n", conf->val.buf); + LOG_ERROR (CHEROKEE_ERROR_VALIDATOR_AUTHLIST_USER, conf->val.buf); return ret_error; } cherokee_buffer_add_buffer (&entry->user, tmp); - TRACE(ENTRIES, "Adding user='%s'\n", entry->user.buf); + TRACE (ENTRIES, "Adding user='%s'\n", entry->user.buf); ret = cherokee_config_node_read (conf, "password", &tmp); if (ret != ret_ok) { - PRINT_MSG ("Couldn't read 'password' value for %s\n", conf->val.buf); + LOG_ERROR (CHEROKEE_ERROR_VALIDATOR_AUTHLIST_PASSWORD, conf->val.buf); return ret_error; } cherokee_buffer_add_buffer (&entry->password, tmp); @@ -144,7 +144,7 @@ */ ret = cherokee_config_node_get (conf, "list", &subconf); if (ret != ret_ok) { - PRINT_MSG_S ("WARNING: Empty authlist: Access will be denied.\n"); + LOG_WARNING_S (CHEROKEE_ERROR_VALIDATOR_AUTHLIST_EMPTY); goto out; } Modified: cherokee/trunk/cherokee/validator_ldap.c =================================================================== --- cherokee/trunk/cherokee/validator_ldap.c 2009-11-16 11:16:18 UTC (rev 3825) +++ cherokee/trunk/cherokee/validator_ldap.c 2009-11-16 13:08:30 UTC (rev 3826) @@ -119,7 +119,7 @@ /* Not handled here */ } else { - PRINT_MSG ("Validator LDAP: Unknown key: '%s'\n", subconf->key.buf); + LOG_CRITICAL (CHEROKEE_ERROR_VALIDATOR_LDAP_KEY, subconf->key.buf); return ret_error; } }
|