]> git.decadent.org.uk Git - nfs-utils.git/blob - support/include/xlog.h
libexport.a: Allow client_init() to fail instead of exit
[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 #include <stdarg.h>
11
12 /* These are logged always. L_FATAL also does exit(1) */
13 #define L_FATAL         0x0100
14 #define L_ERROR         0x0200
15 #define L_WARNING       0x0400
16 #define L_NOTICE        0x0800
17 #define L_ALL           0xFF00
18
19 /* These are logged if enabled with xlog_[s]config */
20 /* NB: code does not expect ORing together D_ and L_ */
21 #define D_GENERAL       0x0001          /* general debug info */
22 #define D_CALL          0x0002
23 #define D_AUTH          0x0004
24 #define D_FAC3          0x0008
25 #define D_FAC4          0x0010
26 #define D_FAC5          0x0020
27 #define D_PARSE         0x0040
28 #define D_FAC7          0x0080
29 #define D_ALL           0x00FF
30
31 /* This can be used to define symbolic log names that can be passed to
32  * xlog_config. */
33 struct xlog_debugfac {
34         char            *df_name;
35         int             df_fac;
36 };
37
38 void                    xlog_open(char *progname);
39 void                    xlog_stderr(int on);
40 void                    xlog_syslog(int on);
41 void                    xlog_config(int fac, int on);
42 void                    xlog_sconfig(char *, int on);
43 int                     xlog_enabled(int fac);
44 void                    xlog(int fac, const char *fmt, ...);
45 void                    xlog_warn(const char *fmt, ...);
46 void                    xlog_err(const char *fmt, ...);
47 void                    xlog_backend(int fac, const char *fmt, va_list args);
48
49 #endif /* XLOG_H */