1 /*
2   log.h
3 
4   Print log messages to syslog, stdout/stderr.
5 
6   $Id: log.h,v 1.5 2002/12/27 21:48:25 bears Exp $
7 */
8 
9 #ifndef LOG_H
10 #define LOG_H
11 
12 #if HAVE_CONFIG_H
13 #include <config.h>
14 #endif
15 
16 #include "common.h"
17 
18 /*
19   Debug logging subsystem identifiers. Can be ORd together.
20   Debug logging can be turned on in the configuration file;
21   by default it is off.
22 */
23 #define	LOG_DBG_CONFIG		(0x0001)
24 #define	LOG_DBG_CONTROL		(0x0002)
25 #define	LOG_DBG_EXPIRE		(0x0004)
26 #define	LOG_DBG_FETCH		(0x0008)
27 #define	LOG_DBG_FILTER		(0x0010)
28 #define	LOG_DBG_NEWSBASE	(0x0020)
29 #define	LOG_DBG_NOFFLE		(0x0040)
30 #define	LOG_DBG_POST		(0x0080)
31 #define	LOG_DBG_PROTOCOL	(0x0100)
32 #define	LOG_DBG_REQUESTS	(0x0200)
33 #define	LOG_DBG_SERVER		(0x0400)
34 #define	LOG_DBG_AUTH		(0x0800)
35 
36 #define	LOG_DBG_ALL		(0xffff)
37 #define	LOG_DBG_NONE		(0x0000)
38 
39 /*
40   Initialise logging (required before using any log functions).
41   name: program name for syslog
42   interactive: print messages also to stderr/stdout
43   facility: like syslog
44 */
45 void
46 Log_init( const char *name, Bool interactive, int facility );
47 
48 /* Log level info */
49 void
50 Log_inf( const char *fmt, ... );
51 
52 /* Log level error */
53 void
54 Log_err( const char *fmt, ... );
55 
56 /* Check for cond being true. Otherwise log an error, and return 1. */
57 int
58 Log_check( int cond, const char *fmt, ... );
59 
60 /* Log level notice */
61 void
62 Log_ntc( const char *fmt, ... );
63 
64 /* Log level debug on indicated subsystem */
65 void
66 Log_dbg( unsigned subsystem, const char *fmt, ... );
67 
68 /* Set debug log mask */
69 void
70 Log_setDbgMask( unsigned mask );
71 
72 /* Fatal error */
73 void
74 Log_fatal( const char *fmt, ... );
75 
76 /* Fatal error in gdbm */
77 void
78 Log_gdbm_fatal( const char *msg );
79 
80 #endif
81