summaryrefslogtreecommitdiffstats
path: root/lib/log
diff options
context:
space:
mode:
authorGeoff Levand <geoff@infradead.org>2012-03-26 19:23:17 -0700
committerGeoff Levand <geoff@infradead.org>2012-03-26 19:23:17 -0700
commit09cc1ef3d7e2c1dab6648aceb24dd33e7897f998 (patch)
treec270bc7b9f5bf0962f87a1681ef8924f10a0e751 /lib/log
parentdbb6ce1119c8fc1f30bb18062b5ab3d6260bb0b1 (diff)
downloadtalos-petitboot-09cc1ef3d7e2c1dab6648aceb24dd33e7897f998.tar.gz
talos-petitboot-09cc1ef3d7e2c1dab6648aceb24dd33e7897f998.zip
Log to stderr, allow --log=-
Signed-off-by: Geoff Levand <geoff@infradead.org>
Diffstat (limited to 'lib/log')
-rw-r--r--lib/log/log.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/log/log.c b/lib/log/log.c
index 697af6c..ecbd714 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -11,7 +11,7 @@ void pb_log(const char *fmt, ...)
va_list ap;
FILE *stream;
- stream = logf ? logf : stdout;
+ stream = logf ? logf : stderr;
va_start(ap, fmt);
vfprintf(stream, fmt, ap);
@@ -23,13 +23,13 @@ void pb_log(const char *fmt, ...)
void pb_log_set_stream(FILE *stream)
{
- fflush(logf ? logf : stdout);
+ fflush(logf ? logf : stderr);
logf = stream;
}
FILE * pb_log_get_stream(void)
{
- return logf;
+ return logf ? logf : stderr;
}
void pb_log_always_flush(int state)
OpenPOWER on IntegriCloud