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:
Michael Stapelberg
2013-12-24 10:35:56 +01:00
parent 28939365cb
commit 0883dfbe14
8 changed files with 41 additions and 7 deletions

View File

@ -72,13 +72,20 @@ struct Font {
/* Since this file also gets included by utilities which dont 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