2009-05-08 11:04:25 -04:00
|
|
|
|
|
|
|
#ifndef __LOGGER_H__
|
|
|
|
#define __LOGGER_H__
|
|
|
|
|
2009-06-01 10:01:47 -04:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
2009-05-08 11:04:25 -04:00
|
|
|
/* Log domains */
|
|
|
|
#define L_CONF 0
|
|
|
|
#define L_DAAP 1
|
|
|
|
#define L_DB 2
|
|
|
|
#define L_HTTPD 3
|
|
|
|
#define L_MAIN 4
|
|
|
|
#define L_MDNS 5
|
|
|
|
#define L_MISC 6
|
2009-06-04 10:04:51 -04:00
|
|
|
#define L_RSP 7
|
|
|
|
#define L_SCAN 8
|
|
|
|
#define L_XCODE 9
|
2009-05-08 12:17:01 -04:00
|
|
|
/* libevent logging */
|
2009-06-04 10:04:51 -04:00
|
|
|
#define L_EVENT 10
|
2009-05-08 11:04:25 -04:00
|
|
|
|
|
|
|
/* Will go away */
|
2009-06-04 10:04:51 -04:00
|
|
|
#define L_LOCK 11
|
|
|
|
#define N_LOGDOMAINS 12
|
2009-05-08 11:04:25 -04:00
|
|
|
|
|
|
|
/* Severities */
|
|
|
|
#define E_FATAL 0
|
|
|
|
#define E_LOG 1
|
|
|
|
#define E_WARN 2
|
|
|
|
#define E_INFO 3
|
|
|
|
#define E_DBG 4
|
|
|
|
#define E_SPAM 5
|
|
|
|
|
|
|
|
|
2009-06-01 10:01:47 -04:00
|
|
|
void
|
|
|
|
vlogger(int severity, int domain, char *fmt, va_list args);
|
|
|
|
|
2009-05-08 11:04:25 -04:00
|
|
|
void
|
|
|
|
DPRINTF(int severity, int domain, char *fmt, ...);
|
|
|
|
|
2009-05-08 12:17:01 -04:00
|
|
|
void
|
|
|
|
logger_libevent(int severity, const char *msg);
|
|
|
|
|
2009-05-08 11:04:25 -04:00
|
|
|
void
|
|
|
|
logger_reinit(void);
|
|
|
|
|
|
|
|
void
|
|
|
|
logger_domains(void);
|
|
|
|
|
|
|
|
void
|
|
|
|
logger_detach(void);
|
|
|
|
|
|
|
|
int
|
|
|
|
logger_init(char *file, char *domains, int severity);
|
|
|
|
|
|
|
|
void
|
|
|
|
logger_deinit(void);
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* !__LOGGER_H__ */
|