i3
include/log.h
Go to the documentation of this file.
00001 /*
00002  * vim:ts=4:sw=4:expandtab
00003  *
00004  * i3 - an improved dynamic tiling window manager
00005  * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
00006  *
00007  * log.c: Setting of loglevels, logging functions.
00008  *
00009  */
00010 #ifndef _LOG_H
00011 #define _LOG_H
00012 
00013 #include <stdarg.h>
00014 #include <stdbool.h>
00015 
00018 #define LOG(fmt, ...) verboselog(fmt, ##__VA_ARGS__)
00019 #define ELOG(fmt, ...) errorlog("ERROR: " fmt, ##__VA_ARGS__)
00020 #define DLOG(fmt, ...) debuglog(LOGLEVEL, "%s:%s:%d - " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
00021 
00022 extern char *loglevels[];
00023 extern char *errorfilename;
00024 
00030 void init_logging();
00031 
00036 void add_loglevel(const char *level);
00037 
00044 void set_verbosity(bool _verbose);
00045 
00051 void debuglog(uint64_t lev, char *fmt, ...);
00052 
00057 void errorlog(char *fmt, ...);
00058 
00064 void verboselog(char *fmt, ...);
00065 
00071 void slog(char *fmt, va_list args);
00072 
00073 #endif