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:
@ -2,7 +2,7 @@
|
||||
* vim:ts=4:sw=4:expandtab
|
||||
*
|
||||
* i3bar - an xcb-based status- and ws-bar for i3
|
||||
* © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
|
||||
* © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
|
||||
*
|
||||
*/
|
||||
#include <stdio.h>
|
||||
@ -17,6 +17,26 @@
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
|
||||
/*
|
||||
* Glob path, i.e. expand ~
|
||||
*
|
||||
|
Reference in New Issue
Block a user