only LOG() the DPI when it changes, DLOG() it otherwise (Thanks lkraav)
This avoids flooding stdout every time some text (e.g. a window decoration) is drawn, yet leaves the message in place when it’s actually relevant (upon DPI changes). fixes #1115
This commit is contained in:
@ -72,13 +72,20 @@ struct Font {
|
||||
/* Since this file also gets included by utilities which don’t use the i3 log
|
||||
* infrastructure, we define a fallback. */
|
||||
#if !defined(LOG)
|
||||
void verboselog(char *fmt, ...);
|
||||
void verboselog(char *fmt, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
#define LOG(fmt, ...) verboselog("[libi3] " __FILE__ " " fmt, ##__VA_ARGS__)
|
||||
#endif
|
||||
#if !defined(ELOG)
|
||||
void errorlog(char *fmt, ...);
|
||||
void errorlog(char *fmt, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
#define ELOG(fmt, ...) errorlog("[libi3] ERROR: " fmt, ##__VA_ARGS__)
|
||||
#endif
|
||||
#if !defined(DLOG)
|
||||
void debuglog(char *fmt, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
#define DLOG(fmt, ...) debuglog("%s:%s:%d - " fmt, I3__FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Try to get the contents of the given atom (for example I3_SOCKET_PATH) from
|
||||
|
@ -21,6 +21,9 @@
|
||||
#if defined(ELOG)
|
||||
#undef ELOG
|
||||
#endif
|
||||
#if defined(DLOG)
|
||||
#undef DLOG
|
||||
#endif
|
||||
/** ##__VA_ARGS__ means: leave out __VA_ARGS__ completely if it is empty, that
|
||||
is, delete the preceding comma */
|
||||
#define LOG(fmt, ...) verboselog(fmt, ##__VA_ARGS__)
|
||||
|
Reference in New Issue
Block a user