]> git.sur5r.net Git - i3/i3lock/blob - i3lock.h
Only output text when in debug mode (fixes problems with xautolock)
[i3/i3lock] / i3lock.h
1 #ifndef _I3LOCK_H
2 #define _I3LOCK_H
3
4 /* This macro will only print debug output when started with --debug.
5  * This is important because xautolock (for example) closes stdout/stderr by
6  * default, so just printing something to stdout will lead to the data ending
7  * up on the X11 socket (!). */
8 #define DEBUG(fmt, ...) do { \
9     if (debug_mode) \
10         printf("[i3lock-debug] " fmt, ##__VA_ARGS__); \
11 } while (0)
12
13 #endif