From d959c5c32af22e0ffa4fa330517b4afa61cda2b7 Mon Sep 17 00:00:00 2001 From: "simon.kagstrom" Date: Sat, 23 May 2009 12:09:16 +0000 Subject: [PATCH] Silence the log writing after a while. Ugly, we should have some /dev/null approach instead --- src/gui-sdl/gui-sdl.c | 3 +++ src/writelog.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui-sdl/gui-sdl.c b/src/gui-sdl/gui-sdl.c index 618e79e..d1f2809 100644 --- a/src/gui-sdl/gui-sdl.c +++ b/src/gui-sdl/gui-sdl.c @@ -574,8 +574,11 @@ void gui_notify_state (int state) { } +extern int log_quiet; int gui_update (void) { + log_quiet = 1; + return 0; } diff --git a/src/writelog.c b/src/writelog.c index 5e758a9..9e533ee 100644 --- a/src/writelog.c +++ b/src/writelog.c @@ -39,12 +39,15 @@ void set_logfile (const char *logfile_name) } } +int log_quiet = 0; + void write_log (const char *fmt, ...) { va_list ap; va_start (ap, fmt); #ifdef HAVE_VFPRINTF - vfprintf (logfile ? logfile : stderr, fmt, ap); + if (!log_quiet) + vfprintf (logfile ? logfile : stderr, fmt, ap); #else /* Technique stolen from GCC. */ {