X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Flog.c;h=e33232aab3a9dd691ab8dd68fdddaf1366b9e70a;hb=5c806927694e99291d278cb80f8a92f7ec5792a0;hp=7fb9ac150a7fca6322ad7dab4166a17f898b0805;hpb=d4a60bd4a784743ed1f5ee425ba2701e310b3689;p=ngircd-alex.git diff --git a/src/ngircd/log.c b/src/ngircd/log.c index 7fb9ac15..e33232aa 100644 --- a/src/ngircd/log.c +++ b/src/ngircd/log.c @@ -9,11 +9,23 @@ * 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.7 2001/12/25 22:04:26 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. + * + * Revision 1.8 2001/12/25 23:13:00 alex + * - Versionsstring bei Programmstart verbessert. + * * Revision 1.7 2001/12/25 22:04:26 alex * - Aenderungen an den Debug- und Logging-Funktionen. * @@ -47,7 +59,11 @@ #include #include #include +#include + +#ifdef USE_SYSLOG #include +#endif #include #include "log.h" @@ -55,15 +71,44 @@ GLOBAL VOID Log_Init( VOID ) { + CHAR txt[64]; + + 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, "-" ); + strcat( txt, "DEBUG" ); +#endif +#ifdef SNIFFER + if( txt[0] ) strcat( txt, "+" ); + else strcat( txt, "-" ); + strcat( txt, "SNIFFER" ); +#endif + +#ifdef USE_SYSLOG openlog( PACKAGE, LOG_CONS|LOG_PID, LOG_LOCAL5 ); - Log( LOG_NOTICE, PACKAGE" version "VERSION" started."); +#endif + Log( LOG_NOTICE, PACKAGE" version "VERSION"%s started.", txt ); } /* Log_Init */ GLOBAL VOID Log_Exit( VOID ) { Log( LOG_NOTICE, PACKAGE" done."); +#ifdef USE_SYSLOG closelog( ); +#endif } /* Log_Exit */ @@ -87,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 */