Remove extra unneeded configuration option from logsys.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1554 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
Steven Dake 2008-06-20 06:04:03 +00:00
parent addd57e7a3
commit 6d7baee4b0
6 changed files with 15 additions and 11 deletions

View File

@ -50,9 +50,8 @@
#define LOG_MODE_DISPLAY_PRIORITY (1<<5)
#define LOG_MODE_DISPLAY_FILELINE (1<<6)
#define LOG_MODE_DISPLAY_TIMESTAMP (1<<7)
#define LOG_MODE_DISPLAY_DEBUG (1<<8)
#define LOG_MODE_BUFFER_BEFORE_CONFIG (1<<9)
#define LOG_MODE_FLUSH_AFTER_CONFIG (1<<10)
#define LOG_MODE_BUFFER_BEFORE_CONFIG (1<<8)
#define LOG_MODE_FLUSH_AFTER_CONFIG (1<<9)
/*
* Log priorities, compliant with syslog and SA Forum Log spec.

View File

@ -83,7 +83,7 @@
#include "version.h"
LOGSYS_DECLARE_SYSTEM ("openais",
LOG_MODE_OUTPUT_STDERR | LOG_MODE_OUTPUT_SYSLOG_THREADED | LOG_MODE_DISPLAY_DEBUG | LOG_MODE_BUFFER_BEFORE_CONFIG,
LOG_MODE_OUTPUT_STDERR | LOG_MODE_OUTPUT_SYSLOG_THREADED | LOG_MODE_BUFFER_BEFORE_CONFIG,
NULL,
LOG_DAEMON);

View File

@ -106,6 +106,7 @@ int openais_main_config_read (
unsigned int object_logger_subsys_handle;
char *value;
char *error_reason = error_string_response;
int global_debug = 0;
memset (main_config, 0, sizeof (struct main_config));
@ -145,10 +146,10 @@ int openais_main_config_read (
if (!objdb_get_string (objdb,object_service_handle, "debug", &value)) {
if (strcmp (value, "on") == 0) {
main_config->logmode |= LOG_MODE_DISPLAY_DEBUG;
global_debug = 1;
} else
if (strcmp (value, "off") == 0) {
main_config->logmode &= ~LOG_MODE_DISPLAY_DEBUG;
global_debug = 0;
} else {
goto parse_error;
}
@ -212,6 +213,11 @@ int openais_main_config_read (
goto parse_error;
}
}
else {
if (global_debug)
logsys_logger.priority = LOG_LEVEL_DEBUG;
}
if (!objdb_get_string (objdb, object_logger_subsys_handle, "tags", &value)) {
char *token = strtok (value, "|");

View File

@ -70,7 +70,6 @@ LOG_MODE_OUTPUT_SYSLOG_BLOCKING: Output all log data without using a thread and
LOG_MODE_DISPLAY_PRIORITY: Output the priority of the log entry in the message contents. This mode is currently not implemented.
LOG_MODE_DISPLAY_FILELINE: Output the file and line at which the log message was created.
LOG_MODE_DISPLAY_TIMESTAMP: Output the timestamp of the message.
LOG_MODE_DISPLAY_DEBUG: Display debug level messages
LOG_MODE_BUFFER_BEFORE_CONFIG: This mode is used to buffer log messages before logsys_mode_config is called. This is useful in applications in which the logging file isn't known before the application is compiled and must be set dynamically. It is also useful when an application calls fork to disconnect the local tty and should hold logging of messages until after the fork.
LOG_MODE_FLUSH_AFTER_CONFIG: This mode is used to flush any buffered messages when the LOG_MODE_BUFFER_BEFORE_CONFIG declartion is specified in the declartion of the logger.
The file parameter specifies the filename that should be used to log messages. This parameter may be NULL if LOG_MODE_OUTPUT_FILE is not specified.

View File

@ -36,7 +36,7 @@
#include "../exec/logsys.h"
LOGSYS_DECLARE_SYSTEM ("logsystestNOsubsystems",
LOG_MODE_OUTPUT_STDERR | LOG_MODE_OUTPUT_SYSLOG_THREADED | LOG_MODE_DISPLAY_DEBUG,
LOG_MODE_OUTPUT_STDERR | LOG_MODE_OUTPUT_SYSLOG_THREADED,
NULL,
LOG_DAEMON);

View File

@ -36,7 +36,7 @@
#include "../exec/logsys.h"
LOGSYS_DECLARE_SYSTEM ("logtest_t2",
LOG_MODE_OUTPUT_STDERR | LOG_MODE_OUTPUT_SYSLOG_THREADED | LOG_MODE_DISPLAY_DEBUG | LOG_MODE_BUFFER_BEFORE_CONFIG,
LOG_MODE_OUTPUT_STDERR | LOG_MODE_OUTPUT_SYSLOG_THREADED | LOG_MODE_BUFFER_BEFORE_CONFIG,
NULL,
LOG_DAEMON);
@ -48,7 +48,7 @@ main(int argc, char **argv)
/*
* fork could occur here and the file to output to could be set
*/
logsys_config_mode_set (LOG_MODE_OUTPUT_STDERR | LOG_MODE_OUTPUT_SYSLOG_THREADED | LOG_MODE_DISPLAY_DEBUG | LOG_MODE_FLUSH_AFTER_CONFIG);
logsys_config_mode_set (LOG_MODE_OUTPUT_STDERR | LOG_MODE_OUTPUT_SYSLOG_THREADED | LOG_MODE_FLUSH_AFTER_CONFIG);
log_printf(LOG_NOTICE, "Hello, world!\n");
log_printf(LOG_DEBUG, "If you see this, the logger's busted\n");
@ -68,7 +68,7 @@ main(int argc, char **argv)
log_printf(LOG_DEBUG, "Debug 1\n");
logsys_config_mode_set (LOG_MODE_DISPLAY_DEBUG | LOG_MODE_OUTPUT_STDERR);
logsys_config_mode_set (LOG_MODE_OUTPUT_STDERR);
log_printf(LOG_DEBUG, "Debug 2\n");