*** empty log message ***
[arla.git] / arlad / arladeb.h
blob3af0be871e35e12c56a15f85a557704815140438
1 /*
2 * Copyright (c) 1995 - 2002 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
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
31 * SUCH DAMAGE.
35 * $Id$
38 #ifndef _arladeb_h
39 #define _arladeb_h
41 #include <stdio.h>
42 #include <stdarg.h>
43 #include <log.h>
45 #include <roken.h>
47 extern Log_method* arla_log_method;
48 extern Log_unit* arla_log_unit;
49 extern struct units arla_deb_units[];
51 /* masks */
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);
82 void
83 arla_err (int eval, unsigned level, int error, const char *fmt, ...)
84 __attribute__ ((noreturn))
85 __attribute__ ((format (printf, 4, 5)))
88 void
89 arla_verr (int eval, unsigned level, int error, const char *fmt, va_list args)
90 __attribute__ ((noreturn))
91 __attribute__ ((format (printf, 4, 0)))
94 void
95 arla_errx (int eval, unsigned level, const char *fmt, ...)
96 __attribute__ ((noreturn))
97 __attribute__ ((format (printf, 3, 4)))
100 void
101 arla_verrx (int eval, unsigned level, const char *fmt, va_list args)
102 __attribute__ ((noreturn))
103 __attribute__ ((format (printf, 3, 0)))
106 void
107 arla_warn (unsigned level, int error, const char *fmt, ...)
108 __attribute__ ((format (printf, 3, 4)))
111 void
112 arla_vwarn (unsigned level, int error, const char *fmt, va_list args)
113 __attribute__ ((format (printf, 3, 0)))
116 void
117 arla_warnx (unsigned level, const char *fmt, ...)
118 __attribute__ ((format (printf, 2, 3)))
121 void
122 arla_vwarnx (unsigned level, const char *fmt, va_list args)
123 __attribute__ ((format (printf, 2, 0)))
126 void
127 arla_warnx_with_fid (unsigned level, const VenusFid *fid, const char *fmt, ...)
128 __attribute__ ((format (printf, 3, 4)));
130 void
131 arla_vwarnx_with_fid (unsigned level, const VenusFid *fid, const char *fmt,
132 va_list args)
133 __attribute__ ((format (printf, 3, 0)));
135 #endif /* _arladeb_h */