Add fatal errors.
Errors are fatal if the program has to stop immediately.
This commit is contained in:
parent
1fee4f5afd
commit
4c1bae86ba
|
@ -63,6 +63,7 @@ void init()
|
|||
keywords::format =
|
||||
"%LineID% [%TimeStamp%] "
|
||||
"[%ThreadID%]: [%Severity%] %Message%");
|
||||
|
||||
boost::log::add_console_log(std::cerr,
|
||||
keywords::format = translate("WARNING").str()
|
||||
+ ": %Message%")
|
||||
|
@ -71,6 +72,11 @@ void init()
|
|||
keywords::format = translate("ERROR").str()
|
||||
+ ": %Message%")
|
||||
->set_filter(boost::log::trivial::severity == sev::error);
|
||||
boost::log::add_console_log(std::cerr,
|
||||
keywords::format = translate("FATAL ERROR")
|
||||
.str()
|
||||
+ ": %Message%")
|
||||
->set_filter(boost::log::trivial::severity == sev::fatal);
|
||||
|
||||
boost::log::add_common_attributes();
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
catch (std::exception &e)
|
||||
{ // Exceptions we can't recover from or ones we don't know.
|
||||
LOG(lg, log::sev::error)
|
||||
LOG(lg, log::sev::fatal)
|
||||
<< e.what() << translate(" (while parsing options)");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user