libdballe  7.7
verbose.h
Go to the documentation of this file.
1 /*
2  * DB-ALLe - Archive for punctual meteorological data
3  *
4  * Copyright (C) 2005,2006 ARPA-SIM <urpsim@smr.arpa.emr.it>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * Author: Enrico Zini <enrico@enricozini.com>
20  */
21 
22 #ifndef DBA_VERBOSE_H
23 #define DBA_VERBOSE_H
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
38 #define DBA_VERBOSE_STREAM stderr
39 
43 enum {
44  DBA_VERB_NONE = 0,
45  DBA_VERB_DB_INPUT = 1,
46  DBA_VERB_DB_SQL = 2,
47  DBA_VERB_BUFREX_MSG = 4,
48 };
49 
55 void dba_verbose_init();
56 
58 void dba_verbose_set_mask(int mask);
59 
63 int dba_verbose_is_allowed(int lev);
64 
69 void dba_verbose(int lev, const char* fmt, ...);
70 
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif
void dba_verbose_set_mask(int mask)
Set the bitmask specifying which messages are printed.
int dba_verbose_is_allowed(int lev)
Return 1 if the given verbose level has been requested in output, else 0.
void dba_verbose_init()
Initialize the verbose printing interface, taking the allowed verbose level from the environment and ...
void dba_verbose(int lev, const char *fmt,...)
Output a message on the verbose stream, if the given level of verbosity has been requested.