Chris Browne cbbrowne at lists.slony.info
Mon Dec 15 15:26:30 PST 2008
Update of /home/cvsd/slony1/slony1-engine/src/slon
In directory main.slony.info:/tmp/cvs-serv17551

Modified Files:
	misc.c 
Log Message:
Fix to logging levels per bug #64
http://bugs.slony.info/bugzilla/show_bug.cgi?id=64



Index: misc.c
===================================================================
RCS file: /home/cvsd/slony1/slony1-engine/src/slon/misc.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** misc.c	17 Sep 2007 22:12:20 -0000	1.26
--- misc.c	15 Dec 2008 23:26:28 -0000	1.27
***************
*** 61,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 */
  
--- 61,66 ----
***************
*** 93,136 ****
  	if (level > slon_log_level)
  		return;
! 
! 	switch (level)
! 	{
! 		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;
! 	}
  
  	va_start(ap, fmt);
--- 89,149 ----
  	if (level > slon_log_level)
  		return;
!     switch (level)
!     {
!         case SLON_DEBUG4:
!             level_c = "DEBUG4";
! #ifdef HAVE_SYSLOG
!             syslog_level = LOG_DEBUG;
! #endif
!             break;
!         case SLON_DEBUG3:
!             level_c = "DEBUG3";
! #ifdef HAVE_SYSLOG
!             syslog_level = LOG_DEBUG;
! #endif
!             break;
!         case SLON_DEBUG2:
!             level_c = "DEBUG2";
! #ifdef HAVE_SYSLOG
!             syslog_level = LOG_DEBUG;
! #endif
!             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";                                                 
! #ifdef HAVE_SYSLOG
!             syslog_level = LOG_WARNING;
! #endif
!             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;                                                              
!     }
  
  	va_start(ap, fmt);



More information about the Slony1-commit mailing list