about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/log.c19
-rw-r--r--src/ngircd/log.h18
2 files changed, 34 insertions, 3 deletions
diff --git a/src/ngircd/log.c b/src/ngircd/log.c
index 6d107592..94686c67 100644
--- a/src/ngircd/log.c
+++ b/src/ngircd/log.c
@@ -9,11 +9,14 @@
  * 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.10 2001/12/27 01:44:49 alex Exp $
  *
  * log.c: Logging-Funktionen
  *
  * $Log: log.c,v $
+ * 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 +57,10 @@
 #include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
+
+#ifdef USE_SYSLOG
 #include <syslog.h>
+#endif
 
 #include <exp.h>
 #include "log.h"
@@ -66,6 +72,11 @@ GLOBAL VOID Log_Init( VOID )
 
 	strcpy( txt, "" );
 
+#ifdef USE_SYSLOG
+	if( txt[0] ) strcat( txt, "+" );
+	else strcat( txt, "-" );
+	strcat( txt, "SYSLOG" );
+#endif
 #ifdef DEBUG
 	if( txt[0] ) strcat( txt, "+" );
 	else strcat( txt, "-" );
@@ -77,7 +88,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 +98,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 +124,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 */
diff --git a/src/ngircd/log.h b/src/ngircd/log.h
index 60e2881f..edd48a59 100644
--- a/src/ngircd/log.h
+++ b/src/ngircd/log.h
@@ -9,11 +9,14 @@
  * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
  * der an comBase beteiligten Autoren finden Sie in der Datei AUTHORS.
  *
- * $Id: log.h,v 1.3 2001/12/12 23:31:24 alex Exp $
+ * $Id: log.h,v 1.4 2001/12/27 01:44:49 alex Exp $
  *
  * log.h: Logging-Funktionen (Header)
  *
  * $Log: log.h,v $
+ * Revision 1.4  2001/12/27 01:44:49  alex
+ * - die Verwendung von syslog kann nun abgeschaltet werden.
+ *
  * Revision 1.3  2001/12/12 23:31:24  alex
  * - Zum Loggen wird nun auch syslog verwendet.
  *
@@ -29,7 +32,18 @@
 #define __log_h__
 
 
-#include <syslog.h>
+#ifdef USE_SYSLOG
+#	include <syslog.h>
+#else
+#	define LOG_EMERG 0
+#	define LOG_ALERT 1
+#	define LOG_CRIT 2
+#	define LOG_ERR 3
+#	define LOG_WARNING 4
+#	define LOG_NOTICE 5
+#	define LOG_INFO 6
+#	define LOG_DEBUG 7
+#endif
 
 
 GLOBAL VOID Log_Init( VOID );