Mercurial > noffle
comparison src/log.c @ 185:fed1334d766b noffle
[svn] * src/client.c: Change variable only used on constant to 'const'.
* src/filter.c: Add a couple of 'return's after ASSERT() to remove
compiler warnings about functions needing returns.
* NEWS,TODO,configure,configure.in,noffle.conf.example,docs/NOTES,
docs/noffle.conf.5,src/client.c,src/configfile.c,src/content.c,
src/control.c,src/database.c,src/fetch.c,src/fetchlist.c,src/filter.c,
src/group.c,src/lock.c,src/log.c,src/log.h,src/noffle.c,src/outgoing.c,
src/post.c,src/protocol.c,src/request.c,src/server.c,src/util.c:
Debug logging is always compiled and selected via noffle.conf. All debug
logs are classified as all, none, config, control, expire, fetch,
filter, newsbase, noffle, post, protocol, requests and server.
author | bears |
---|---|
date | Sun, 05 Aug 2001 09:24:22 +0100 |
parents | c874bd3c4bb8 |
children | 755e03bc7dcf |
comparison
equal
deleted
inserted
replaced
184:9854ea5f295f | 185:fed1334d766b |
---|---|
1 /* | 1 /* |
2 log.c | 2 log.c |
3 | 3 |
4 $Id: log.c 79 2000-05-13 15:35:17Z bears $ | 4 $Id: log.c 300 2001-08-05 08:24:22Z bears $ |
5 */ | 5 */ |
6 | 6 |
7 #if HAVE_CONFIG_H | 7 #if HAVE_CONFIG_H |
8 #include <config.h> | 8 #include <config.h> |
9 #endif | 9 #endif |
14 #include "log.h" | 14 #include "log.h" |
15 #include "portable.h" | 15 #include "portable.h" |
16 | 16 |
17 #define MAXLENGTH 240 | 17 #define MAXLENGTH 240 |
18 | 18 |
19 #define DEFAULT_DBG_MASK LOG_DBG_NONE | |
20 | |
19 struct | 21 struct |
20 { | 22 { |
21 Bool interactive; | 23 Bool interactive; |
22 } log = { FALSE }; | 24 unsigned debugMask; |
25 } log = { FALSE, DEFAULT_DBG_MASK }; | |
23 | 26 |
24 void | 27 void |
25 Log_init( const char *name, Bool interactive, int facility ) | 28 Log_init( const char *name, Bool interactive, int facility ) |
26 { | 29 { |
27 int option = LOG_PID | LOG_CONS; | 30 int option = LOG_PID | LOG_CONS; |
71 { | 74 { |
72 DO_LOG( LOG_NOTICE ); | 75 DO_LOG( LOG_NOTICE ); |
73 } | 76 } |
74 | 77 |
75 void | 78 void |
76 Log_dbg( const char *fmt, ... ) | 79 Log_dbg( unsigned subsystem, const char *fmt, ... ) |
77 { | 80 { |
78 #ifdef DEBUG | 81 if ( ( subsystem & log.debugMask ) != 0 ) { |
79 DO_LOG( LOG_DEBUG ); | 82 DO_LOG( LOG_DEBUG ); |
80 #endif | 83 } |
81 } | 84 } |
85 | |
86 void | |
87 Log_setDbgMask( unsigned mask ) | |
88 { | |
89 /* A non-zero mask always include Noffle logs */ | |
90 if ( mask != 0 ) | |
91 mask |= LOG_DBG_NOFFLE; | |
92 | |
93 log.debugMask = mask; | |
94 } |