leafnode  1.12.0
About: Leafnode is a store & forward NNTP proxy for small (dialup) sites.
  Fossies Dox: leafnode-1.12.0.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ln_log.h
Go to the documentation of this file.
1#ifndef LNLOG_H
2#define LNLOG_H
3
4#include <stdarg.h>
5
6/* severities */
7/* in analogy to syslog levels, are passed on to syslog */
8#if 0
9#define LNLOG_SEMERG 0 /* system is unusable */
10#define LNLOG_SALERT 1 /* action must be taken immediately */
11#endif
12#define LNLOG_SCRIT 2 /* critical conditions */
13#define LNLOG_SERR 3 /* * error conditions */
14#define LNLOG_SWARNING 4 /* * warning conditions */
15#define LNLOG_SNOTICE 5 /* * normal but significant condition */
16#define LNLOG_SINFO 6 /* * informational */
17#define LNLOG_SDEBUG 7 /* * debug-level messages */
18#define LNLOG_SMIN 2 /* minimal used severity */
19/* contexts */
20/* define the context the log message occurs in
21 think of it as "verbose level" */
22#define LNLOG_CTOP 1 /* top level, always log */
23#define LNLOG_CSERVER 2 /* server context */
24#define LNLOG_CGROUP 3 /* group context */
25#define LNLOG_CARTICLE 4 /* article context */
26#define LNLOG_CALL 5 /* most verbose */
27
28/* IMPORT */
29extern int verbose;
30
31/* EXPORT */
32extern void ln_log_open(const char *ident); /** open log, use \a ident as log tag */
33extern void ln_log_use_console(int en); /** allow logging to console depending on \a en */
34
35/* log to stderr and syslog */
36extern void ln_log(int severity, int context, const char *format, ...)
37#ifdef __GNUC__
38 __attribute__ ((format(printf, 3, 4)))
39#endif
40 ;
41
42/* log to stdout and syslog */
43extern void ln_log_so(int severity, int context, const char *format, ...)
44#ifdef __GNUC__
45 __attribute__ ((format(printf, 3, 4)))
46#endif
47 ;
48
49/* log to stderr only */
50extern void ln_log_prt(int severity, int context, const char *format, ...)
51#ifdef __GNUC__
52 __attribute__ ((format(printf, 3, 4)))
53#endif
54 ;
55
56/* log to syslog only */
57extern void ln_log_sys(int severity, int context, const char *format, ...)
58#ifdef __GNUC__
59 __attribute__ ((format(printf, 3, 4)))
60#endif
61 ;
62#endif
int verbose
Definition: applyfilter.c:31
void ln_log_prt(int severity, int context, const char *format,...)
Definition: ln_log.c:123
void ln_log_open(const char *ident)
void ln_log(int severity, int context, const char *format,...)
Definition: ln_log.c:103
void ln_log_use_console(int en)
Definition: ln_log.c:31
void ln_log_so(int severity, int context, const char *format,...)
Definition: ln_log.c:113
void ln_log_sys(int severity, int context, const char *format,...)
Definition: ln_log.c:133