summaryrefslogtreecommitdiff
path: root/include/wolf/log.h
blob: 7e18c5f8fa7b5854572da4ffc17bbf0d84ddf70a (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef WOLF_LOG_H
#define WOLF_LOG_H

#ifdef __cplusplus
extern "C" {
#endif

#define log_EMERG       0       /* system is unusable */
#define log_ALERT       1       /* action must be taken immediately */
#define log_CRIT        2       /* critical conditions */
#define log_ERR         3       /* error conditions */
#define log_WARNING     4       /* warning conditions */
#define log_NOTICE      5       /* normal but significant condition */
#define log_INFO        6       /* informational */
#define log_DEBUG       7       /* debug-level messages */

#define log_DEBUG1 ( log_DEBUG + 1 )
#define log_DEBUG2 ( log_DEBUG + 2 )
#define log_DEBUG3 ( log_DEBUG + 3 )
#define log_DEBUG4 ( log_DEBUG + 4 )
#define log_DEBUG5 ( log_DEBUG + 5 )

#define	log_KERN	(0<<3)	/* kernel messages */
#define	log_USER	(1<<3)	/* random user-level messages */
#define	log_MAIL	(2<<3)	/* mail system */
#define	log_DAEMON	(3<<3)	/* system daemons */
#define	log_AUTH	(4<<3)	/* security/authorization messages */
#define	log_SYSLOG	(5<<3)	/* messages generated internally by syslogd */
#define	log_LPR		(6<<3)	/* line printer subsystem */
#define	log_NEWS	(7<<3)	/* network news subsystem */
#define	log_UUCP	(8<<3)	/* UUCP subsystem */
#define	log_CRON	(9<<3)	/* clock daemon */
#define	log_AUTHPRIV	(10<<3)	/* security/authorization messages (private) */
#define	log_FTP		(11<<3)	/* ftp daemon */

const char *log_syslog_facility_to_str( int facility );

int log_str_to_syslog_facility( const char *facility );

const char *log_level_to_str( int level );

int log_str_to_level( const char *level );

void openlogtofile( const char *filename, int level );

void openlogtosyslog( const char *ident, int facility, int level );

void openlogtostderr( int level );

void closelogtofile( void );

void closelogtosyslog( void );

void closelogtostderr( void );

void reopenlogtofile( void );

void reopenlogtosyslog( void );

void LOG( int level, const char *format, ... );

#ifdef __cplusplus
}
#endif

#endif /* ifndef WOLF_LOG_H */