]> git.decadent.org.uk Git - nfs-utils.git/blob - support/include/xlog.h
From: Kevin Coffman <kwc@citi.umich.edu>
[nfs-utils.git] / support / include / xlog.h
1 /*
2  * xlog         Logging functionality
3  *
4  * Copyright (C) 1995 Olaf Kirch <okir@monad.swb.de>
5  */
6
7 #ifndef XLOG_H
8 #define XLOG_H
9
10 /* These are logged always. L_FATAL also does exit(1) */
11 #define L_FATAL         0x0100
12 #define L_ERROR         0x0200
13 #define L_WARNING       0x0400
14 #define L_NOTICE        0x0800
15 #define L_ALL           0xFF00
16
17 /* These are logged if enabled with xlog_[s]config */
18 /* NB: code does not expect ORing together D_ and L_ */
19 #define D_GENERAL       0x0001          /* general debug info */
20 #define D_CALL          0x0002
21 #define D_AUTH          0x0004
22 #define D_FAC3          0x0008
23 #define D_FAC4          0x0010
24 #define D_FAC5          0x0020
25 #define D_PARSE         0x0040
26 #define D_FAC7          0x0080
27 #define D_ALL           0x00FF
28
29 /* This can be used to define symbolic log names that can be passed to
30  * xlog_config. */
31 struct xlog_debugfac {
32         char            *df_name;
33         int             df_fac;
34 };
35
36 void                    xlog_open(char *progname);
37 void                    xlog_stderr(int on);
38 void                    xlog_syslog(int on);
39 void                    xlog_config(int fac, int on);
40 void                    xlog_sconfig(char *, int on);
41 int                     xlog_enabled(int fac);
42 void                    xlog(int fac, const char *fmt, ...);
43
44 #endif /* XLOG_H */