annotate src/log.h @ 480:5d32ceec7f25 noffle

[svn] * docs/FAQ: Improve X-NOFFLE-Status entry.
author bears
date Wed, 13 Oct 2004 22:49:53 +0100
parents 5eece4dfd945
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
43
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
1 /*
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
2 log.h
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
3
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
4 Print log messages to syslog, stdout/stderr.
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
5
281
5eece4dfd945 [svn] * src/log.c,src/log.h: Add Log_fatal() for reporting fatal errors
bears
parents: 185
diff changeset
6 $Id: log.h 413 2002-12-27 21:48:25Z bears $
43
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
7 */
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
8
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
9 #ifndef LOG_H
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
10 #define LOG_H
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
11
45
32ba1198c6fa [svn] * Makefile.in, configure, configure.in, docs/Makefile.in, src/Makefile.in:
uh1763
parents: 43
diff changeset
12 #if HAVE_CONFIG_H
32ba1198c6fa [svn] * Makefile.in, configure, configure.in, docs/Makefile.in, src/Makefile.in:
uh1763
parents: 43
diff changeset
13 #include <config.h>
32ba1198c6fa [svn] * Makefile.in, configure, configure.in, docs/Makefile.in, src/Makefile.in:
uh1763
parents: 43
diff changeset
14 #endif
32ba1198c6fa [svn] * Makefile.in, configure, configure.in, docs/Makefile.in, src/Makefile.in:
uh1763
parents: 43
diff changeset
15
43
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
16 #include "common.h"
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
17
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
18 /*
185
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
19 Debug logging subsystem identifiers. Can be ORd together.
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
20 Debug logging can be turned on in the configuration file;
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
21 by default it is off.
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
22 */
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
23 #define LOG_DBG_CONFIG (0x0001)
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
24 #define LOG_DBG_CONTROL (0x0002)
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
25 #define LOG_DBG_EXPIRE (0x0004)
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
26 #define LOG_DBG_FETCH (0x0008)
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
27 #define LOG_DBG_FILTER (0x0010)
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
28 #define LOG_DBG_NEWSBASE (0x0020)
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
29 #define LOG_DBG_NOFFLE (0x0040)
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
30 #define LOG_DBG_POST (0x0080)
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
31 #define LOG_DBG_PROTOCOL (0x0100)
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
32 #define LOG_DBG_REQUESTS (0x0200)
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
33 #define LOG_DBG_SERVER (0x0400)
281
5eece4dfd945 [svn] * src/log.c,src/log.h: Add Log_fatal() for reporting fatal errors
bears
parents: 185
diff changeset
34 #define LOG_DBG_AUTH (0x0800)
185
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
35
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
36 #define LOG_DBG_ALL (0xffff)
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
37 #define LOG_DBG_NONE (0x0000)
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
38
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
39 /*
43
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
40 Initialise logging (required before using any log functions).
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
41 name: program name for syslog
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
42 interactive: print messages also to stderr/stdout
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
43 facility: like syslog
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
44 */
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
45 void
73
c874bd3c4bb8 [svn] Adjust consting
bears
parents: 45
diff changeset
46 Log_init( const char *name, Bool interactive, int facility );
43
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
47
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
48 /* Log level info */
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
49 void
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
50 Log_inf( const char *fmt, ... );
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
51
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
52 /* Log level error */
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
53 void
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
54 Log_err( const char *fmt, ... );
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
55
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
56 /* Check for cond being true. Otherwise log an error, and return 1. */
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
57 int
185
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
58 Log_check( int cond, const char *fmt, ... );
43
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
59
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
60 /* Log level notice */
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
61 void
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
62 Log_ntc( const char *fmt, ... );
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
63
185
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
64 /* Log level debug on indicated subsystem */
43
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
65 void
185
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
66 Log_dbg( unsigned subsystem, const char *fmt, ... );
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
67
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
68 /* Set debug log mask */
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
69 void
fed1334d766b [svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents: 73
diff changeset
70 Log_setDbgMask( unsigned mask );
43
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
71
281
5eece4dfd945 [svn] * src/log.c,src/log.h: Add Log_fatal() for reporting fatal errors
bears
parents: 185
diff changeset
72 /* Fatal error */
5eece4dfd945 [svn] * src/log.c,src/log.h: Add Log_fatal() for reporting fatal errors
bears
parents: 185
diff changeset
73 void
5eece4dfd945 [svn] * src/log.c,src/log.h: Add Log_fatal() for reporting fatal errors
bears
parents: 185
diff changeset
74 Log_fatal( const char *fmt, ... );
5eece4dfd945 [svn] * src/log.c,src/log.h: Add Log_fatal() for reporting fatal errors
bears
parents: 185
diff changeset
75
5eece4dfd945 [svn] * src/log.c,src/log.h: Add Log_fatal() for reporting fatal errors
bears
parents: 185
diff changeset
76 /* Fatal error in gdbm */
5eece4dfd945 [svn] * src/log.c,src/log.h: Add Log_fatal() for reporting fatal errors
bears
parents: 185
diff changeset
77 void
5eece4dfd945 [svn] * src/log.c,src/log.h: Add Log_fatal() for reporting fatal errors
bears
parents: 185
diff changeset
78 Log_gdbm_fatal( const char *msg );
5eece4dfd945 [svn] * src/log.c,src/log.h: Add Log_fatal() for reporting fatal errors
bears
parents: 185
diff changeset
79
43
2842f50feb55 [svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff changeset
80 #endif