diff options
author | David Shah <dave@ds0.me> | 2018-11-26 09:22:42 +0000 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2018-11-26 09:22:42 +0000 |
commit | b035cb9fcf3502c74c769560f02e29adcafe6fd8 (patch) | |
tree | 597f9f963f5ed1ab6d6644f8f5d9a21c917e453d /common/log.cc | |
parent | 51d1363dfeb7005ec35a2acd10fe9ae2cd8631d5 (diff) | |
download | nextpnr-b035cb9fcf3502c74c769560f02e29adcafe6fd8.tar.gz nextpnr-b035cb9fcf3502c74c769560f02e29adcafe6fd8.tar.bz2 nextpnr-b035cb9fcf3502c74c769560f02e29adcafe6fd8.zip |
Add nonfatal error support and use for timing failures
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'common/log.cc')
-rw-r--r-- | common/log.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/common/log.cc b/common/log.cc index 19873148..82e09fec 100644 --- a/common/log.cc +++ b/common/log.cc @@ -39,6 +39,7 @@ std::string log_last_error; void (*log_error_atexit)() = NULL; static int log_newline_count = 0; +bool had_nonfatal_error = false; std::string stringf(const char *fmt, ...) { @@ -177,6 +178,15 @@ void log_break() log("\n"); } +void log_nonfatal_error(const char *format, ...) +{ + va_list ap; + va_start(ap, format); + logv_prefixed("ERROR: ", format, ap, LogLevel::ERROR); + va_end(ap); + had_nonfatal_error = true; +} + void log_flush() { for (auto f : log_streams) |