Chris Browne cbbrowne at lists.slony.info
Mon Sep 17 15:12:22 PDT 2007
Update of /home/cvsd/slony1/slony1-engine/src/slon
In directory main.slony.info:/tmp/cvs-serv12298

Modified Files:
	misc.c 
Log Message:
Fix syslog option handling (via adding a #ifdef-wrapped parameterized macro)...

Several syslog options did not have any option remapping Slony-I debug levels
to syslog levels, with the result that those levels got mapped, by syslog, to
being ERRORs, which wasn't valid.


Index: misc.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slon/misc.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** misc.c	20 Apr 2007 20:53:18 -0000	1.25
--- misc.c	17 Sep 2007 22:12:20 -0000	1.26
***************
*** 60,66 ****
  
  static void write_syslog(int level, const char *line);
! #else
  
  #define Use_syslog 0
  #endif   /* HAVE_SYSLOG */
  
--- 60,70 ----
  
  static void write_syslog(int level, const char *line);
! 
! #define set_syslog_level(x) syslog_level = x;
! #else    /* HAVE_SYSLOG */
  
  #define Use_syslog 0
+ 
+ #define set_syslog_level(x) ;
  #endif   /* HAVE_SYSLOG */
  
***************
*** 83,86 ****
--- 87,91 ----
  	time_t		stamp_time = time(NULL);
  
+ 	
  #ifdef HAVE_SYSLOG
  	int			syslog_level = LOG_ERR;
***************
*** 93,136 ****
  		case SLON_DEBUG4:
  			level_c = "DEBUG4";
  			break;
  		case SLON_DEBUG3:
  			level_c = "DEBUG3";
  			break;
  		case SLON_DEBUG2:
  			level_c = "DEBUG2";
  			break;
  		case SLON_DEBUG1:
  			level_c = "DEBUG1";
! #ifdef HAVE_SYSLOG
! 			syslog_level = LOG_DEBUG;
! #endif
  			break;
  		case SLON_INFO:
  			level_c = "INFO";
! #ifdef HAVE_SYSLOG
! 			syslog_level = LOG_INFO;
! #endif
  			break;
  		case SLON_CONFIG:
  			level_c = "CONFIG";
  			break;
  		case SLON_WARN:
  			level_c = "WARN";
! #ifdef HAVE_SYSLOG
! 			syslog_level = LOG_WARNING;
! #endif
  			break;
  		case SLON_ERROR:
  			level_c = "ERROR";
! #ifdef HAVE_SYSLOG
! 			syslog_level = LOG_ERR;
! #endif
  			break;
  		case SLON_FATAL:
  			level_c = "FATAL";
! #ifdef HAVE_SYSLOG
! 			syslog_level = LOG_ERR;
! #endif
! 
  			break;
  	}
--- 98,134 ----
  		case SLON_DEBUG4:
  			level_c = "DEBUG4";
+ 			set_syslog_level(LOG_DEBUG);
  			break;
  		case SLON_DEBUG3:
  			level_c = "DEBUG3";
+ 			set_syslog_level(LOG_DEBUG);
  			break;
  		case SLON_DEBUG2:
  			level_c = "DEBUG2";
+ 			set_syslog_level(LOG_DEBUG);
  			break;
  		case SLON_DEBUG1:
  			level_c = "DEBUG1";
! 			set_syslog_level(LOG_DEBUG);
  			break;
  		case SLON_INFO:
  			level_c = "INFO";
! 			set_syslog_level(LOG_INFO);
  			break;
  		case SLON_CONFIG:
  			level_c = "CONFIG";
+ 			set_syslog_level(LOG_NOTICE);
  			break;
  		case SLON_WARN:
  			level_c = "WARN";
! 			set_syslog_level(LOG_WARNING);
  			break;
  		case SLON_ERROR:
  			level_c = "ERROR";
! 			set_syslog_level(LOG_ERR);
  			break;
  		case SLON_FATAL:
  			level_c = "FATAL";
! 			set_syslog_level(LOG_ERR);
  			break;
  	}



More information about the Slony1-commit mailing list