/[pengfork]/pengfork/src/log.c
ViewVC logotype

Diff of /pengfork/src/log.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by nes, Thu Aug 29 21:18:46 2002 UTC revision 1.3 by nes, Thu Aug 29 22:01:39 2002 UTC
# Line 29  Line 29 
29  int  int
30  init_log (void)  init_log (void)
31  {  {
32    int flags = 0;    openlog ("pengfork", 0, LOG_DAEMON);
33      return 0;
 #ifdef LOG_PERROR  
   flags = LOG_PERROR;  
 #endif  
   openlog ("pengfork", flags, LOG_DAEMON);  
   return 1;  
34  }  }
35    
36  int  int
# Line 44  log (int level, char *format, ...) Line 39  log (int level, char *format, ...)
39    va_list ap;    va_list ap;
40    va_start (ap, format);    va_start (ap, format);
41        
42  #ifndef LOG_ERROR    if (!PARAM_DAEMON)
43    vfprintf (stderr, format, ap);      vfprintf (stderr, format, ap);
44  #endif    else
45    syslog (level, format, ap);      syslog (level, format, ap);
46    return 0;    return 0;
47  }  }
48    
# Line 58  debug (int level, char *format, ...) Line 53  debug (int level, char *format, ...)
53    
54    va_start (ap, format);    va_start (ap, format);
55    if (level <= PARAM_DEBUG_LEVEL)    if (level <= PARAM_DEBUG_LEVEL)
56      vfprintf (stderr, format, ap);      vfprintf (stdout, format, ap);
57    
58    return 0;    return 0;
59  }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26