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:
Michael Stapelberg
2012-08-13 13:27:00 +02:00
parent 6c9bf84d4e
commit 2896ae8057
6 changed files with 88 additions and 7 deletions

View File

@ -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