slony1-bugs at lists.slony.info slony1-bugs at lists.slony.info
Tue Nov 25 17:29:14 PST 2008
http://www.slony.info/bugzilla/show_bug.cgi?id=64

           Summary: Syslog error levels do NOT cascade
           Product: Slony-I
           Version: 1.1
          Platform: Macintosh
        OS/Version: Mac OS
            Status: NEW
          Severity: minor
          Priority: low
         Component: slon
        AssignedTo: slony1-bugs at lists.slony.info
        ReportedBy: dba at richyen.com
                CC: slony1-bugs at lists.slony.info
   Estimated Hours: 0.0


In the switch statement in misc.c (lines 95-140), "break;" lines at each "case"
clause creates undesired syslog_level.

i.e., if SLON_DEBUG4, syslog_level never gets set to LOG_DEBUG.

Correct code should be:

    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;                                                              
    }


-- 
Configure bugmail: http://www.slony.info/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Slony1-bugs mailing list