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  *
00006  * © 2009-2011 Michael Stapelberg and contributors
00007  *
00008  * See file LICENSE for license information.
00009  *
00010  */
00011 #ifndef _LOG_H
00012 #define _LOG_H
00013 
00014 #include <stdarg.h>
00015 #include <stdbool.h>
00016 
00019 #define LOG(fmt, ...) verboselog(fmt, ##__VA_ARGS__)
00020 #define ELOG(fmt, ...) errorlog("ERROR: " fmt, ##__VA_ARGS__)
00021 #define DLOG(fmt, ...) debuglog(LOGLEVEL, "%s:%s:%d - " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
00022 
00023 extern char *loglevels[];
00024 extern char *errorfilename;
00025 
00031 void init_logging();
00032 
00037 void add_loglevel(const char *level);
00038 
00045 void set_verbosity(bool _verbose);
00046 
00052 void debuglog(uint64_t lev, char *fmt, ...);
00053 
00058 void errorlog(char *fmt, ...);
00059 
00065 void verboselog(char *fmt, ...);
00066 
00072 void slog(char *fmt, va_list args);
00073 
00074 #endif