-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog.h
41 lines (31 loc) · 764 Bytes
/
log.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* LOG functions header file
* Copyright (C) 2006 Unix Solutions Ltd.
*
* Released under MIT license.
* See LICENSE-MIT.txt for license terms.
*/
#ifndef LOG_H
# define LOG_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
void log_init (char *host_ident, int use_syslog, int use_stderr, char *log_host, int log_port);
void log_close (void);
void LOG (const char *msg);
__attribute__ ((format(printf, 1, 2)))
void LOGf(const char *fmt, ...);
void log_perror(const char *message, int _errno);
void log_set_out_fd(FILE *new_out_fd);
#ifdef DEBUG
#define dbg_LOG LOG
#define dbg_LOGf LOGf
#else
#define dbg_LOG(arg) do { /* arg */ } while(0)
#define dbg_LOGf(...) do { /* ... */ } while(0)
#endif
#ifdef __cplusplus
}
#endif
#endif