logging: make libi3 use verboselog()/errorlog(), provide it in each caller
While this is a bit ugly, it makes the log messages end up where they are supposed to: in the shmlog/stdout in case of i3 and on stdout in case of utilities such as i3-input
This commit is contained in:
@ -84,6 +84,26 @@ Display *dpy;
|
||||
char *rewrite_binding(const char *bindingline);
|
||||
static void finish();
|
||||
|
||||
/*
|
||||
* Having verboselog() and errorlog() is necessary when using libi3.
|
||||
*
|
||||
*/
|
||||
void verboselog(char *fmt, ...) {
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
vfprintf(stdout, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void errorlog(char *fmt, ...) {
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
vfprintf(stderr, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function resolves ~ in pathnames.
|
||||
* It may resolve wildcards in the first part of the path, but if no match
|
||||
|
Reference in New Issue
Block a user