]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/log.c
- new allocated connection structures will be initialized correctly now.
[ngircd-alex.git] / src / ngircd / log.c
index 9708eadc3f8f342f1171caa64cc4861a07f8f90e..79f3c6fef7b9234506210fdb499b27e2b2dfd6a7 100644 (file)
@@ -2,21 +2,20 @@
  * ngIRCd -- The Next Generation IRC Daemon
  * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
  *
- * Dieses Programm ist freie Software. Sie koennen es unter den Bedingungen
- * der GNU General Public License (GPL), wie von der Free Software Foundation
- * herausgegeben, weitergeben und/oder modifizieren, entweder unter Version 2
- * der Lizenz oder (wenn Sie es wuenschen) jeder spaeteren Version.
- * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
- * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * Please read the file COPYING, README and AUTHORS for more information.
  *
- * $Id: log.c,v 1.36 2002/09/03 17:25:45 alex Exp $
- *
- * log.c: Logging-Funktionen
+ * Logging functions
  */
 
 
 #include "portab.h"
 
+static char UNUSED id[] = "$Id: log.c,v 1.41 2002/12/12 12:24:18 alex Exp $";
+
 #include "imp.h"
 #include <assert.h>
 #include <errno.h>
@@ -96,7 +95,7 @@ Log_InitErrorfile( VOID )
         * landen z.B. alle Ausgaben von assert()-Aufrufen. */
 
        /* Dateiname zusammen bauen */
-       sprintf( Error_File, "%s/%s-%ld.err", ERROR_DIR, PACKAGE, (INT32)getpid( ));
+       sprintf( Error_File, "%s/%s-%ld.err", ERROR_DIR, PACKAGE, (LONG)getpid( ));
 
        /* stderr umlenken */
        fflush( stderr );
@@ -181,6 +180,13 @@ va_dcl
                fprintf( stdout, "[%d] %s\n", Level, msg );
                fflush( stdout );
        }
+#ifdef USE_SYSLOG
+       else
+       {
+               /* Syslog */
+               syslog( Level, "%s", msg );
+       }
+#endif
 
        if( Level <= LOG_CRIT )
        {
@@ -189,11 +195,6 @@ va_dcl
                fflush( stderr );
        }
 
-#ifdef USE_SYSLOG
-       /* Syslog */
-       syslog( Level, msg );
-#endif
-
        if( snotice )
        {
                /* NOTICE an lokale User mit "s"-Mode */
@@ -242,6 +243,8 @@ va_dcl
 
        assert( Format != NULL );
 
+       if( NGIRCd_NoDaemon ) return;
+
 #ifdef DEBUG
        if(( Level == LOG_DEBUG ) && ( ! NGIRCd_Debug )) return;
 #else
@@ -276,7 +279,7 @@ Wall_ServerNotice( CHAR *Msg )
        c = Client_First( );
        while( c )
        {
-               if(( Client_Conn( c ) > NONE ) && ( Client_HasMode( c, 's' ))) IRC_WriteStrClient( c, "NOTICE %s :%s", Client_ThisServer( ), Msg );
+               if(( Client_Conn( c ) > NONE ) && ( Client_HasMode( c, 's' ))) IRC_WriteStrClient( c, "NOTICE %s :%s%s", Client_ThisServer( ), NOTICE_TXTPREFIX, Msg );
                c = Client_Next( c );
        }
 } /* Wall_ServerNotice */