log.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * ngIRCd -- The Next Generation IRC Daemon
  3. * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. * Please read the file COPYING, README and AUTHORS for more information.
  10. *
  11. * $Id: log.h,v 1.19.2.1 2006/12/02 13:02:07 fw Exp $
  12. *
  13. * Logging functions (header)
  14. */
  15. #ifndef __log_h__
  16. #define __log_h__
  17. #ifdef SYSLOG
  18. # include <syslog.h>
  19. #else
  20. # define LOG_EMERG 0
  21. # define LOG_ALERT 1
  22. # define LOG_CRIT 2
  23. # define LOG_ERR 3
  24. # define LOG_WARNING 4
  25. # define LOG_NOTICE 5
  26. # define LOG_INFO 6
  27. # define LOG_DEBUG 7
  28. #endif
  29. #define LOG_snotice 1024
  30. GLOBAL void Log_Init PARAMS(( bool Daemon_Mode ));
  31. GLOBAL void Log_Exit PARAMS(( void ));
  32. GLOBAL void Log PARAMS(( int Level, const char *Format, ... ));
  33. #ifdef DEBUG
  34. GLOBAL void LogDebug PARAMS(( const char *Format, ... ));
  35. #else
  36. static inline void LogDebug PARAMS(( UNUSED const char *Format, ... )){/* Do nothing. The compiler should optimize this out, please ;-) */}
  37. #endif
  38. GLOBAL void Log_Init_Resolver PARAMS(( void ));
  39. GLOBAL void Log_Exit_Resolver PARAMS(( void ));
  40. GLOBAL void Log_Resolver PARAMS(( const int Level, const char *Format, ... ));
  41. #ifdef DEBUG
  42. GLOBAL void Log_InitErrorfile PARAMS(( void ));
  43. #endif
  44. #endif
  45. /* -eof- */