From: Clifford Wolf Date: Sat, 3 Jan 2015 21:10:33 +0000 (+0100) Subject: Print non-errors to stdout X-Git-Tag: yosys-0.5~138 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f9304e6c10713f713a17f280507f045451863246;p=yosys.git Print non-errors to stdout --- 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;