add vararg versions of Error::all() and Error::one() plus unit tests
This commit is contained in:
@ -213,6 +213,30 @@ void Error::one(const std::string &file, int line, const std::string &str)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
forward vararg version to single string version
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Error::_all(const std::string &file, int line, fmt::string_view format,
|
||||
fmt::format_args args)
|
||||
{
|
||||
try {
|
||||
all(file,line,fmt::vformat(format, args));
|
||||
} catch (fmt::format_error &e) {
|
||||
all(file,line,e.what());
|
||||
}
|
||||
}
|
||||
|
||||
void Error::_one(const std::string &file, int line, fmt::string_view format,
|
||||
fmt::format_args args)
|
||||
{
|
||||
try {
|
||||
one(file,line,fmt::vformat(format, args));
|
||||
} catch (fmt::format_error &e) {
|
||||
one(file,line,e.what());
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
called by one proc in world
|
||||
only write to screen if non-nullptr on this proc since could be file
|
||||
|
||||
Reference in New Issue
Block a user