Mercurial > noffle
annotate src/log.h @ 269:b3a2f710fe2c noffle
[svn] * src/server.c: Fix post 1.0 bug where the article cursor was lost if the
server yielded the lock to another server.
author | bears |
---|---|
date | Fri, 25 Oct 2002 12:04:57 +0100 |
parents | fed1334d766b |
children | 5eece4dfd945 |
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 |
185
fed1334d766b
[svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents:
73
diff
changeset
|
6 $Id: log.h 300 2001-08-05 08:24:22Z 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) |
fed1334d766b
[svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents:
73
diff
changeset
|
34 |
fed1334d766b
[svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents:
73
diff
changeset
|
35 #define LOG_DBG_ALL (0xffff) |
fed1334d766b
[svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents:
73
diff
changeset
|
36 #define LOG_DBG_NONE (0x0000) |
fed1334d766b
[svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents:
73
diff
changeset
|
37 |
fed1334d766b
[svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents:
73
diff
changeset
|
38 /* |
43
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
39 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
|
40 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
|
41 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
|
42 facility: like syslog |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
43 */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
44 void |
73 | 45 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
|
46 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
47 /* Log level info */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
48 void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
49 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
|
50 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
51 /* Log level error */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
52 void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
53 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
|
54 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
55 /* 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
|
56 int |
185
fed1334d766b
[svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents:
73
diff
changeset
|
57 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
|
58 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
59 /* Log level notice */ |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
60 void |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
61 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
|
62 |
185
fed1334d766b
[svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents:
73
diff
changeset
|
63 /* 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
|
64 void |
185
fed1334d766b
[svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents:
73
diff
changeset
|
65 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
|
66 |
fed1334d766b
[svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents:
73
diff
changeset
|
67 /* Set debug log mask */ |
fed1334d766b
[svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents:
73
diff
changeset
|
68 void |
fed1334d766b
[svn] * src/client.c: Change variable only used on constant to 'const'.
bears
parents:
73
diff
changeset
|
69 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
|
70 |
2842f50feb55
[svn] * client.c, client.h, common.h, config.c, config.h, content.c, content.h,
uh1763
parents:
diff
changeset
|
71 #endif |