Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only output text when in debug mode (fixes problems with xautolock)
- Loading branch information
1 parent
2053e98
commit be21951
Showing
3 changed files
with
31 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef _I3LOCK_H | ||
#define _I3LOCK_H | ||
|
||
/* This macro will only print debug output when started with --debug. | ||
* This is important because xautolock (for example) closes stdout/stderr by | ||
* default, so just printing something to stdout will lead to the data ending | ||
* up on the X11 socket (!). */ | ||
#define DEBUG(fmt, ...) do { \ | ||
if (debug_mode) \ | ||
printf("[i3lock-debug] " fmt, ##__VA_ARGS__); \ | ||
} while (0) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters