[Openais-commits] r1554 - in trunk: exec man test

sdake at developer.osdl.org sdake at developer.osdl.org
Thu Jun 19 23:04:03 PDT 2008


Author: sdake
Date: 2008-06-19 23:04:03 -0700 (Thu, 19 Jun 2008)
New Revision: 1554

Modified:
   trunk/exec/logsys.h
   trunk/exec/main.c
   trunk/exec/mainconfig.c
   trunk/man/logsys_overview.8
   trunk/test/logsys_t1.c
   trunk/test/logsys_t2.c
Log:
Remove extra unneeded configuration option from logsys.


Modified: trunk/exec/logsys.h
===================================================================
--- trunk/exec/logsys.h	2008-06-20 05:54:11 UTC (rev 1553)
+++ trunk/exec/logsys.h	2008-06-20 06:04:03 UTC (rev 1554)
@@ -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.

Modified: trunk/exec/main.c
===================================================================
--- trunk/exec/main.c	2008-06-20 05:54:11 UTC (rev 1553)
+++ trunk/exec/main.c	2008-06-20 06:04:03 UTC (rev 1554)
@@ -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);
 

Modified: trunk/exec/mainconfig.c
===================================================================
--- trunk/exec/mainconfig.c	2008-06-20 05:54:11 UTC (rev 1553)
+++ trunk/exec/mainconfig.c	2008-06-20 06:04:03 UTC (rev 1554)
@@ -106,6 +106,7 @@
 	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 @@
 
 		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 @@
 					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, "|");
 

Modified: trunk/man/logsys_overview.8
===================================================================
--- trunk/man/logsys_overview.8	2008-06-20 05:54:11 UTC (rev 1553)
+++ trunk/man/logsys_overview.8	2008-06-20 06:04:03 UTC (rev 1554)
@@ -70,7 +70,6 @@
 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.

Modified: trunk/test/logsys_t1.c
===================================================================
--- trunk/test/logsys_t1.c	2008-06-20 05:54:11 UTC (rev 1553)
+++ trunk/test/logsys_t1.c	2008-06-20 06:04:03 UTC (rev 1554)
@@ -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);
 

Modified: trunk/test/logsys_t2.c
===================================================================
--- trunk/test/logsys_t2.c	2008-06-20 05:54:11 UTC (rev 1553)
+++ trunk/test/logsys_t2.c	2008-06-20 06:04:03 UTC (rev 1554)
@@ -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 @@
 	/*
 	 * 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 @@
 
 	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");
 



More information about the Openais-commits mailing list