2 * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the Institute nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47 extern Log_method
* arla_log_method
;
48 extern Log_unit
* arla_log_unit
;
49 extern struct units arla_deb_units
[];
52 #define ADEBANY 0xffffffff
53 #define ADEBMISC 0x00000001 /* misc debugging */
54 #define ADEBCONN 0x00000002 /* conncache */
55 #define ADEBINIT 0x00000004 /* initialization debug */
56 #define ADEBFCACHE 0x00000008 /* file cache */
57 #define ADEBVOLCACHE 0x00000010 /* volume cache */
58 #define ADEBCM 0x00000020 /* cache manager */
59 #define ADEBCALLBACK 0x00000040 /* callbacks */
60 #define ADEBCLEANER 0x00000080 /* cleaner */
61 #define ADEBKERNEL 0x00000100 /* kernel interface */
62 #define ADEBMSG 0x00000200 /* messages */
63 #define ADEBFBUF 0x00000400 /* fbuf */
64 #define ADEBDISCONN 0x00000800 /* disconn */
65 #define ADEBWARN 0x08000000 /* don't ignore warning */
66 #define ADEBERROR 0x10000000 /* don't ignore error */
67 #define ADEBVLOG 0x20000000 /* venuslog output */
68 #define ADEBINVALIDATOR 0x40000000 /* invalidator output */
70 #define ARLA_DEFAULT_LOG (ADEBWARN | ADEBERROR)
72 extern struct units arla_deb_units
[];
74 void arla_log(unsigned level
, const char *fmt
, ...);
75 void arla_loginit(char *logname
, log_flags flags
);
76 int arla_log_set_level (const char *s
);
77 void arla_log_set_level_num (unsigned level
);
78 void arla_log_get_level (char *s
, size_t len
);
79 unsigned arla_log_get_level_num (void);
80 void arla_log_print_levels (FILE *f
);
83 arla_err (int eval
, unsigned level
, int error
, const char *fmt
, ...)
84 __attribute__ ((noreturn
))
85 __attribute__ ((format (printf
, 4, 5)))
89 arla_verr (int eval
, unsigned level
, int error
, const char *fmt
, va_list args
)
90 __attribute__ ((noreturn
))
91 __attribute__ ((format (printf
, 4, 0)))
95 arla_errx (int eval
, unsigned level
, const char *fmt
, ...)
96 __attribute__ ((noreturn
))
97 __attribute__ ((format (printf
, 3, 4)))
101 arla_verrx (int eval
, unsigned level
, const char *fmt
, va_list args
)
102 __attribute__ ((noreturn
))
103 __attribute__ ((format (printf
, 3, 0)))
107 arla_warn (unsigned level
, int error
, const char *fmt
, ...)
108 __attribute__ ((format (printf
, 3, 4)))
112 arla_vwarn (unsigned level
, int error
, const char *fmt
, va_list args
)
113 __attribute__ ((format (printf
, 3, 0)))
117 arla_warnx (unsigned level
, const char *fmt
, ...)
118 __attribute__ ((format (printf
, 2, 3)))
122 arla_vwarnx (unsigned level
, const char *fmt
, va_list args
)
123 __attribute__ ((format (printf
, 2, 0)))
127 arla_warnx_with_fid (unsigned level
, const VenusFid
*fid
, const char *fmt
, ...)
128 __attribute__ ((format (printf
, 3, 4)));
131 arla_vwarnx_with_fid (unsigned level
, const VenusFid
*fid
, const char *fmt
,
133 __attribute__ ((format (printf
, 3, 0)));
135 #endif /* _arladeb_h */