i3
log.h
Go to the documentation of this file.
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
6  *
7  * log.c: Setting of loglevels, logging functions.
8  *
9  */
10 #ifndef _LOG_H
11 #define _LOG_H
12 
13 #include <stdarg.h>
14 #include <stdbool.h>
15 
18 #define LOG(fmt, ...) verboselog(fmt, ##__VA_ARGS__)
19 #define ELOG(fmt, ...) errorlog("ERROR: " fmt, ##__VA_ARGS__)
20 #define DLOG(fmt, ...) debuglog(LOGLEVEL, "%s:%s:%d - " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
21 
22 extern char *loglevels[];
23 extern char *errorfilename;
24 extern char *shmlogname;
25 extern int shmlog_size;
26 
32 void init_logging(void);
33 
38 void add_loglevel(const char *level);
39 
46 void set_verbosity(bool _verbose);
47 
53 void debuglog(uint64_t lev, char *fmt, ...);
54 
59 void errorlog(char *fmt, ...);
60 
66 void verboselog(char *fmt, ...);
67 
73 void slog(char *fmt, va_list args);
74 
75 #endif