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: 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("%s:%s:%d - " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
22 extern char *errorfilename;
23 extern char *shmlogname;
24 extern int shmlog_size;
27 * Initializes logging by creating an error logfile in /tmp (or
28 * XDG_RUNTIME_DIR, see get_process_filename()).
31 void init_logging(void);
37 void set_debug_logging(const bool _debug_logging);
40 * Set verbosity of i3. If verbose is set to true, informative messages will
41 * be printed to stdout. If verbose is set to false, only errors will be
45 void set_verbosity(bool _verbose);
48 * Logs the given message to stdout while prefixing the current time to it,
49 * but only if debug logging was activated.
52 void debuglog(char *fmt, ...);
55 * Logs the given message to stdout while prefixing the current time to it.
58 void errorlog(char *fmt, ...);
61 * Logs the given message to stdout while prefixing the current time to it,
62 * but only if verbose mode is activated.
65 void verboselog(char *fmt, ...);
68 * Logs the given message to stdout while prefixing the current time to it.
69 * This is to be called by LOG() which includes filename/linenumber
72 void slog(char *fmt, va_list args);