From ee2674cda8fb348362ff202d17ce3bdcbac8b6e1 Mon Sep 17 00:00:00 2001 From: kunitoki Date: Tue, 10 Apr 2012 16:46:11 +0200 Subject: [PATCH] - force a file close to flush debug outputs when setting back logging from file to console --- src/debug.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/debug.cpp b/src/debug.cpp index 69d920c09..391f4d64d 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -154,7 +154,14 @@ void logger::use_console() saved_buf_ = std::clog.rdbuf(); } + // close the file to force a flush + if (file_output_.is_open()) + { + file_output_.close(); + } + std::clog.rdbuf(saved_buf_); } -} + +} // namespace mapnik