summaryrefslogtreecommitdiff
path: root/kernel/log.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-02 16:03:18 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-02 18:14:21 +0200
commit768eb846c4473040dc07bf62ce631c8a21474ae8 (patch)
tree9f5b1c860360b0bdd488cc668d80d44c84aca822 /kernel/log.cc
parent08392aad8f8e7c5bbcfa010c19786b1f318028b6 (diff)
More bugfixes related to new RTLIL::IdString
Diffstat (limited to 'kernel/log.cc')
-rw-r--r--kernel/log.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/kernel/log.cc b/kernel/log.cc
index 9cabc6a8..01f6207e 100644
--- a/kernel/log.cc
+++ b/kernel/log.cc
@@ -90,22 +90,25 @@ void logv(const char *format, va_list ap)
void logv_header(const char *format, va_list ap)
{
+ bool pop_errfile = false;
+
log("\n");
if (header_count.size() > 0)
header_count.back()++;
+
+ if (int(header_count.size()) <= log_verbose_level && log_errfile != NULL) {
+ log_files.push_back(log_errfile);
+ pop_errfile = true;
+ }
+
for (int c : header_count)
log("%d.", c);
log(" ");
logv(format, ap);
log_flush();
- if (int(header_count.size()) <= log_verbose_level && log_errfile != NULL) {
- for (int c : header_count)
- fprintf(log_errfile, "%d.", c);
- fprintf(log_errfile, " ");
- vfprintf(log_errfile, format, ap);
- fflush(log_errfile);
- }
+ if (pop_errfile)
+ log_files.pop_back();
}
void logv_error(const char *format, va_list ap)