2 * vim:ts=4:sw=4:expandtab
4 * i3 - an improved dynamic tiling window manager
5 * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
7 * log.c: Setting of loglevels, logging functions.
16 /** ##__VA_ARGS__ means: leave out __VA_ARGS__ completely if it is empty, that
17 is, delete the preceding comma */
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__)
22 extern char *loglevels[];
23 extern char *errorfilename;
26 * Initializes logging by creating an error logfile in /tmp (or
27 * XDG_RUNTIME_DIR, see get_process_filename()).
33 * Enables the given loglevel.
36 void add_loglevel(const char *level);
39 * Set verbosity of i3. If verbose is set to true, informative messages will
40 * be printed to stdout. If verbose is set to false, only errors will be
44 void set_verbosity(bool _verbose);
47 * Logs the given message to stdout while prefixing the current time to it,
48 * but only if the corresponding debug loglevel was activated.
51 void debuglog(uint64_t lev, char *fmt, ...);
54 * Logs the given message to stdout while prefixing the current time to it.
57 void errorlog(char *fmt, ...);
60 * Logs the given message to stdout while prefixing the current time to it,
61 * but only if verbose mode is activated.
64 void verboselog(char *fmt, ...);
67 * Logs the given message to stdout while prefixing the current time to it.
68 * This is to be called by LOG() which includes filename/linenumber
71 void slog(char *fmt, va_list args);