X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Flog.c;h=e33232aab3a9dd691ab8dd68fdddaf1366b9e70a;hp=6d10759253f4e70fc5064405ecb67986db839127;hb=680e2ad6b160069a20716fe4472567db8f2a358f;hpb=3be92e9d70ebf81f80c721c6a1d556f3f9ef6447 diff --git a/src/ngircd/log.c b/src/ngircd/log.c index 6d107592..e33232aa 100644 --- a/src/ngircd/log.c +++ b/src/ngircd/log.c @@ -9,11 +9,17 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an comBase beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: log.c,v 1.9 2001/12/26 03:22:16 alex Exp $ + * $Id: log.c,v 1.11 2001/12/29 03:08:49 alex Exp $ * * log.c: Logging-Funktionen * * $Log: log.c,v $ + * Revision 1.11 2001/12/29 03:08:49 alex + * - neue configure-Option "--enable-strict-rfc". + * + * Revision 1.10 2001/12/27 01:44:49 alex + * - die Verwendung von syslog kann nun abgeschaltet werden. + * * Revision 1.9 2001/12/26 03:22:16 alex * - string.h wird nun includiert. * @@ -54,7 +60,10 @@ #include #include #include + +#ifdef USE_SYSLOG #include +#endif #include #include "log.h" @@ -66,6 +75,16 @@ GLOBAL VOID Log_Init( VOID ) strcpy( txt, "" ); +#ifdef USE_SYSLOG + if( txt[0] ) strcat( txt, "+" ); + else strcat( txt, "-" ); + strcat( txt, "SYSLOG" ); +#endif +#ifdef STRICT_RFC + if( txt[0] ) strcat( txt, "+" ); + else strcat( txt, "-" ); + strcat( txt, "RFC" ); +#endif #ifdef DEBUG if( txt[0] ) strcat( txt, "+" ); else strcat( txt, "-" ); @@ -77,7 +96,9 @@ GLOBAL VOID Log_Init( VOID ) strcat( txt, "SNIFFER" ); #endif +#ifdef USE_SYSLOG openlog( PACKAGE, LOG_CONS|LOG_PID, LOG_LOCAL5 ); +#endif Log( LOG_NOTICE, PACKAGE" version "VERSION"%s started.", txt ); } /* Log_Init */ @@ -85,7 +106,9 @@ GLOBAL VOID Log_Init( VOID ) GLOBAL VOID Log_Exit( VOID ) { Log( LOG_NOTICE, PACKAGE" done."); +#ifdef USE_SYSLOG closelog( ); +#endif } /* Log_Exit */ @@ -109,7 +132,9 @@ GLOBAL VOID Log( CONST INT Level, CONST CHAR *Format, ... ) /* ... und ausgeben */ printf( "[%d] %s\n", Level, msg ); +#ifdef USE_SYSLOG syslog( Level, msg ); +#endif va_end( ap ); } /* Log */