2001-12-11 22:53:04 +01:00
|
|
|
/*
|
|
|
|
* ngIRCd -- The Next Generation IRC Daemon
|
2010-05-22 17:10:22 +02:00
|
|
|
* Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
|
2001-12-11 22:53:04 +01:00
|
|
|
*
|
2002-12-12 13:23:43 +01:00
|
|
|
* 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.
|
2001-12-11 22:53:04 +01:00
|
|
|
*
|
2002-12-12 13:23:43 +01:00
|
|
|
* Logging functions (header)
|
2001-12-11 22:53:04 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __log_h__
|
|
|
|
#define __log_h__
|
|
|
|
|
|
|
|
|
2003-12-26 16:55:07 +01:00
|
|
|
#ifdef SYSLOG
|
2001-12-27 02:44:49 +01:00
|
|
|
# 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
|
2001-12-11 22:53:04 +01:00
|
|
|
|
|
|
|
|
2002-03-27 21:53:30 +01:00
|
|
|
#define LOG_snotice 1024
|
2002-03-25 18:17:08 +01:00
|
|
|
|
|
|
|
|
2005-06-24 21:55:10 +02:00
|
|
|
GLOBAL void Log_Init PARAMS(( bool Daemon_Mode ));
|
|
|
|
GLOBAL void Log_Exit PARAMS(( void ));
|
2001-12-11 22:53:04 +01:00
|
|
|
|
2005-06-24 21:55:10 +02:00
|
|
|
GLOBAL void Log PARAMS(( int Level, const char *Format, ... ));
|
2006-08-05 11:16:21 +02:00
|
|
|
|
2010-05-22 17:10:22 +02:00
|
|
|
GLOBAL void Log_ServerNotice PARAMS((char UserMode, const char *Format, ...));
|
|
|
|
|
2006-08-05 11:16:21 +02:00
|
|
|
#ifdef DEBUG
|
2006-02-08 18:33:28 +01:00
|
|
|
GLOBAL void LogDebug PARAMS(( const char *Format, ... ));
|
2006-08-05 11:16:21 +02:00
|
|
|
#else
|
|
|
|
static inline void LogDebug PARAMS(( UNUSED const char *Format, ... )){/* Do nothing. The compiler should optimize this out, please ;-) */}
|
|
|
|
#endif
|
|
|
|
|
2010-07-01 00:34:56 +02:00
|
|
|
GLOBAL void Log_Init_Subprocess PARAMS((char *Name));
|
|
|
|
GLOBAL void Log_Exit_Subprocess PARAMS((char *Name));
|
2001-12-29 21:16:31 +01:00
|
|
|
|
2010-07-01 00:34:56 +02:00
|
|
|
GLOBAL void Log_Subprocess PARAMS((const int Level, const char *Format, ...));
|
2001-12-29 21:16:31 +01:00
|
|
|
|
2005-02-10 13:49:04 +01:00
|
|
|
#ifdef DEBUG
|
2005-06-24 21:55:10 +02:00
|
|
|
GLOBAL void Log_InitErrorfile PARAMS(( void ));
|
2005-02-10 13:49:04 +01:00
|
|
|
#endif
|
|
|
|
|
2001-12-11 22:53:04 +01:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* -eof- */
|