5 #define NETDATA_LOG_H 1
7 #define D_WEB_BUFFER 0x00000001
8 #define D_WEB_CLIENT 0x00000002
9 #define D_LISTENER 0x00000004
10 #define D_WEB_DATA 0x00000008
11 #define D_OPTIONS 0x00000010
12 #define D_PROCNETDEV_LOOP 0x00000020
13 #define D_RRD_STATS 0x00000040
14 #define D_WEB_CLIENT_ACCESS 0x00000080
15 #define D_TC_LOOP 0x00000100
16 #define D_DEFLATE 0x00000200
17 #define D_CONFIG 0x00000400
18 #define D_PLUGINSD 0x00000800
19 #define D_CHILDS 0x00001000
20 #define D_EXIT 0x00002000
21 #define D_CHECKS 0x00004000
22 #define D_NFACCT_LOOP 0x00008000
23 #define D_PROCFILE 0x00010000
25 #define DEBUG (D_WEB_CLIENT_ACCESS|D_LISTENER|D_RRD_STATS)
26 //#define DEBUG 0xffffffff
29 extern unsigned long long debug_flags;
34 extern FILE *stdaccess;
36 extern int access_log_syslog;
37 extern int error_log_syslog;
38 extern int output_log_syslog;
40 #define debug(type, args...) do { if(!silent && debug_flags & type) debug_int(__FILE__, __FUNCTION__, __LINE__, ##args); } while(0)
41 #define info(args...) info_int(__FILE__, __FUNCTION__, __LINE__, ##args)
42 #define error(args...) error_int(__FILE__, __FUNCTION__, __LINE__, ##args)
43 #define fatal(args...) fatal_int(__FILE__, __FUNCTION__, __LINE__, ##args)
45 extern void log_date(FILE *out);
46 extern void debug_int( const char *file, const char *function, const unsigned long line, const char *fmt, ... );
47 extern void info_int( const char *file, const char *function, const unsigned long line, const char *fmt, ... );
48 extern void error_int( const char *file, const char *function, const unsigned long line, const char *fmt, ... );
49 extern void fatal_int( const char *file, const char *function, const unsigned long line, const char *fmt, ... );
50 extern void log_access( const char *fmt, ... );
52 #endif /* NETDATA_LOG_H */