diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-01-03 22:10:33 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-01-03 22:10:33 +0100 |
commit | f9304e6c10713f713a17f280507f045451863246 (patch) | |
tree | da6b19ac7f2a52fd89921d62047cabfbb77d3904 /kernel | |
parent | 45918b8315423cb91400a0127550a1d54220c447 (diff) | |
download | yosys-f9304e6c10713f713a17f280507f045451863246.tar.gz yosys-f9304e6c10713f713a17f280507f045451863246.tar.bz2 yosys-f9304e6c10713f713a17f280507f045451863246.zip |
Print non-errors to stdout
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/driver.cc | 6 | ||||
-rw-r--r-- | kernel/log.cc | 6 | ||||
-rw-r--r-- | kernel/log.h | 1 |
3 files changed, 11 insertions, 2 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc index f1bf0657b..2cbdba8f3 100644 --- a/kernel/driver.cc +++ b/kernel/driver.cc @@ -268,8 +268,10 @@ int main(int argc, char **argv) } } - if (log_errfile == NULL) - log_files.push_back(stderr); + if (log_errfile == NULL) { + log_files.push_back(stdout); + log_error_stderr = true; + } if (print_banner) { log("\n"); diff --git a/kernel/log.cc b/kernel/log.cc index b984f0112..2be425ffd 100644 --- a/kernel/log.cc +++ b/kernel/log.cc @@ -44,6 +44,7 @@ FILE *log_errfile = NULL; SHA1 *log_hasher = NULL; bool log_time = false; +bool log_error_stderr = false; bool log_cmd_error_throw = false; bool log_quiet_warnings = false; int log_verbose_level; @@ -175,6 +176,11 @@ void logv_error(const char *format, va_list ap) if (log_errfile != NULL) log_files.push_back(log_errfile); + if (log_error_stderr) + for (auto &f : log_files) + if (f == stdout) + f = stderr; + log("ERROR: "); logv(format, ap); log_flush(); diff --git a/kernel/log.h b/kernel/log.h index 8096758f6..fa02d2396 100644 --- a/kernel/log.h +++ b/kernel/log.h @@ -46,6 +46,7 @@ extern FILE *log_errfile; extern SHA1 *log_hasher; extern bool log_time; +extern bool log_error_stderr; extern bool log_cmd_error_throw; extern bool log_quiet_warnings; extern int log_verbose_level; |