OpenDNSSEC-signer  1.3.16
log.h
Go to the documentation of this file.
1 /*
2  * $Id: log.h 3845 2010-08-31 14:19:24Z matthijs $
3  *
4  * Copyright (c) 2009 NLnet Labs. 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  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
19  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
21  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
23  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
25  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  */
28 
34 #ifndef SHARED_LOG_H
35 #define SHARED_LOG_H
36 
37 #include "config.h"
38 
39 #include <stdio.h>
40 #include <stdarg.h>
41 
49 void ods_log_init(const char *filename, int use_syslog, int verbosity);
50 
55 void ods_log_close(void);
56 
63 int ods_log_get_facility(const char* facility);
64 
70 int ods_log_get_level();
71 
77 void ods_log_deeebug(const char *format, ...);
78 
84 void ods_log_debug(const char *format, ...);
85 
91 void ods_log_verbose(const char *format, ...);
92 
98 void ods_log_info(const char *format, ...);
99 
105 void ods_log_warning(const char *format, ...);
106 
112 void ods_log_error(const char *format, ...);
113 
119 void ods_log_crit(const char *format, ...);
120 
126 void ods_log_alert(const char *format, ...);
127 
133 void ods_fatal_exit(const char *format, ...);
134 
139 #define ODS_LOG_DEBUG 1
140 #ifdef ODS_LOG_DEBUG
141 #define ods_log_assert(x) \
142  do { if(!(x)) \
143  ods_fatal_exit("%s:%d: %s: assertion %s failed", \
144  __FILE__, __LINE__, __func__, #x); \
145  } while(0);
146 
147 #else
148 #define ods_log_assert(x)
149 #endif
150 
151 #endif /* SHARED_LOG_H */
void ods_log_alert(const char *format,...)
Definition: log.c:381
void ods_log_debug(const char *format,...)
Definition: log.c:285
void ods_fatal_exit(const char *format,...)
Definition: log.c:397
void ods_log_info(const char *format,...)
Definition: log.c:317
void ods_log_error(const char *format,...)
Definition: log.c:349
int ods_log_get_facility(const char *facility)
void ods_log_crit(const char *format,...)
Definition: log.c:365
void ods_log_close(void)
Definition: log.c:151
int ods_log_get_level()
Definition: log.c:222
void ods_log_verbose(const char *format,...)
Definition: log.c:301
void ods_log_deeebug(const char *format,...)
Definition: log.c:269
void ods_log_init(const char *filename, int use_syslog, int verbosity)
Definition: log.c:96
void ods_log_warning(const char *format,...)
Definition: log.c:333