Ver Fonte

Allow users of logsys to disable output of logging LOG_LEVEL_DEBUG messages
via log_mode_set.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1576 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake há 17 anos atrás
pai
commit
eef9f0644b
3 ficheiros alterados com 5 adições e 2 exclusões
  1. 3 1
      exec/logsys.c
  2. 1 0
      exec/logsys.h
  3. 1 1
      man/logsys_overview.8

+ 3 - 1
exec/logsys.c

@@ -277,7 +277,9 @@ static void log_printf_worker_fn (void *thread_data, void *work_item)
 		fflush (stdout);
 		fflush (stdout);
 	}
 	}
 
 
-	if (logsys_mode & LOG_MODE_OUTPUT_SYSLOG_THREADED) {
+	if ((logsys_mode & LOG_MODE_OUTPUT_SYSLOG_THREADED) &&
+		(!((logsys_mode & LOG_MODE_FILTER_DEBUG_FROM_SYSLOG) &&
+		   (log_data->priority == LOG_LEVEL_DEBUG)))) {
 		syslog (log_data->priority,
 		syslog (log_data->priority,
 			&log_data->log_string[log_data->syslog_pos]);
 			&log_data->log_string[log_data->syslog_pos]);
 	}
 	}

+ 1 - 0
exec/logsys.h

@@ -55,6 +55,7 @@
 #define LOG_MODE_FLUSH_AFTER_CONFIG	(1<<9)
 #define LOG_MODE_FLUSH_AFTER_CONFIG	(1<<9)
 #define LOG_MODE_SHORT_FILELINE		(1<<10)
 #define LOG_MODE_SHORT_FILELINE		(1<<10)
 #define LOG_MODE_NOSUBSYS		(1<<11)
 #define LOG_MODE_NOSUBSYS		(1<<11)
+#define LOG_MODE_FILTER_DEBUG_FROM_SYSLOG	(1<<12)
 
 
 /*
 /*
  * Log priorities, compliant with syslog and SA Forum Log spec.
  * Log priorities, compliant with syslog and SA Forum Log spec.

+ 1 - 1
man/logsys_overview.8

@@ -77,7 +77,7 @@ The file parameter specifies the filename that should be used to log messages.
 The facility parameter is the syslog facility that should be used when logging
 The facility parameter is the syslog facility that should be used when logging
 messages.
 messages.
 LOG_MODE_NOSUBSYS: Enabling this mode removes the subsystem tag from the beginning of the log lines.  This is not recommended for programs which have multiple subsystems.
 LOG_MODE_NOSUBSYS: Enabling this mode removes the subsystem tag from the beginning of the log lines.  This is not recommended for programs which have multiple subsystems.
-
+LOG_MODE_FILTER_DEBUG_FROM_SYSLOG: Enabling this mode will stop debug messages from being sent to syslog.
 
 
 An example declaration would be:
 An example declaration would be: