Merge remote-tracking branch 'upstream/master' into sta_update_upstream_lvf_stuff
This commit is contained in:
commit
dce012ee17
|
|
@ -61,7 +61,11 @@ public:
|
||||||
void report(std::string_view fmt,
|
void report(std::string_view fmt,
|
||||||
Args &&...args)
|
Args &&...args)
|
||||||
{
|
{
|
||||||
reportLine(sta::vformat(fmt, sta::make_format_args(args...)));
|
reportMsg(sta::vformat(fmt, sta::make_format_args(args...)));
|
||||||
|
}
|
||||||
|
virtual void reportMsg(const std::string &formatted_msg)
|
||||||
|
{
|
||||||
|
reportLine(formatted_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////
|
||||||
|
|
@ -72,11 +76,14 @@ public:
|
||||||
std::string_view fmt,
|
std::string_view fmt,
|
||||||
Args &&...args)
|
Args &&...args)
|
||||||
{
|
{
|
||||||
if (!isSuppressed(id)) {
|
if (!isSuppressed(id))
|
||||||
reportLine(sta::format(
|
warnMsg(id, sta::vformat(fmt, sta::make_format_args(args...)));
|
||||||
"Warning {}: {}", id, sta::vformat(fmt, sta::make_format_args(args...))));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
virtual void warnMsg(int id,
|
||||||
|
const std::string &formatted_msg) {
|
||||||
|
reportLine(sta::format("Warning {}: {}", id, formatted_msg));
|
||||||
|
}
|
||||||
|
|
||||||
// Report warning in a file.
|
// Report warning in a file.
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
void fileWarn(int id,
|
void fileWarn(int id,
|
||||||
|
|
@ -86,19 +93,30 @@ public:
|
||||||
Args &&...args)
|
Args &&...args)
|
||||||
{
|
{
|
||||||
if (!isSuppressed(id)) {
|
if (!isSuppressed(id)) {
|
||||||
reportLine(
|
fileWarnMsg(id, filename, line,
|
||||||
sta::format("Warning {}: {} line {}, {}", id, filename, line,
|
sta::vformat(fmt, sta::make_format_args(args...)));
|
||||||
sta::vformat(fmt, sta::make_format_args(args...))));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
virtual void
|
||||||
|
fileWarnMsg(int id,
|
||||||
|
std::string_view filename,
|
||||||
|
int line,
|
||||||
|
const std::string &formatted_msg) {
|
||||||
|
reportLine(sta::format("Warning {}: {} line {}, {}",
|
||||||
|
id, filename, line, formatted_msg));
|
||||||
|
}
|
||||||
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
void error(int id,
|
void error(int id,
|
||||||
std::string_view fmt,
|
std::string_view fmt,
|
||||||
Args &&...args)
|
Args &&...args)
|
||||||
{
|
{
|
||||||
std::string msg = sta::vformat(fmt, sta::make_format_args(args...));
|
errorMsg(id, sta::vformat(fmt, sta::make_format_args(args...)));
|
||||||
reportThrowExceptionMsg(sta::format("{} {}", id, msg), isSuppressed(id));
|
}
|
||||||
|
virtual void errorMsg(int id,
|
||||||
|
const std::string &formatted_msg)
|
||||||
|
{
|
||||||
|
reportThrowExceptionMsg(sta::format("{} {}", id, formatted_msg), isSuppressed(id));
|
||||||
}
|
}
|
||||||
// Report error in a file.
|
// Report error in a file.
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
|
|
@ -108,8 +126,16 @@ public:
|
||||||
std::string_view fmt,
|
std::string_view fmt,
|
||||||
Args &&...args)
|
Args &&...args)
|
||||||
{
|
{
|
||||||
const std::string msg = sta::vformat(fmt, sta::make_format_args(args...));
|
fileErrorMsg(id, filename, line,
|
||||||
reportThrowExceptionMsg(sta::format("{} {} line {}, {}", id, filename, line, msg),
|
sta::vformat(fmt, sta::make_format_args(args...)));
|
||||||
|
}
|
||||||
|
virtual void fileErrorMsg(int id,
|
||||||
|
std::string_view filename,
|
||||||
|
int line,
|
||||||
|
const std::string &formatted_msg)
|
||||||
|
{
|
||||||
|
reportThrowExceptionMsg(sta::format("{} {} line {}, {}",
|
||||||
|
id, filename, line, formatted_msg),
|
||||||
isSuppressed(id));
|
isSuppressed(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -121,19 +147,32 @@ public:
|
||||||
std::string_view fmt,
|
std::string_view fmt,
|
||||||
Args &&...args)
|
Args &&...args)
|
||||||
{
|
{
|
||||||
reportLine(sta::format("Critical {}: {}", id,
|
criticalMsg(id, sta::vformat(fmt, sta::make_format_args(args...)));
|
||||||
sta::vformat(fmt, sta::make_format_args(args...))));
|
}
|
||||||
|
virtual void criticalMsg(int id,
|
||||||
|
const std::string &formatted_msg)
|
||||||
|
{
|
||||||
|
reportLine(sta::format("Critical {}: {}", id, formatted_msg));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename... Args>
|
template <typename... Args>
|
||||||
void fileCritical(int id,
|
void fileCritical(int id,
|
||||||
std::string_view filename,
|
std::string_view filename,
|
||||||
int line,
|
int line,
|
||||||
std::string_view fmt,
|
std::string_view fmt,
|
||||||
Args &&...args)
|
Args &&...args)
|
||||||
|
{
|
||||||
|
fileCriticalMsg(id, filename, line,
|
||||||
|
sta::vformat(fmt, sta::make_format_args(args...)));
|
||||||
|
}
|
||||||
|
virtual void fileCriticalMsg(int id,
|
||||||
|
std::string_view filename,
|
||||||
|
int line,
|
||||||
|
const std::string &formatted_msg)
|
||||||
{
|
{
|
||||||
reportLine(sta::format("Critical {}: {} line {}, {}", id, filename, line,
|
reportLine(sta::format("Critical {}: {} line {}, {}", id, filename, line,
|
||||||
sta::vformat(fmt, sta::make_format_args(args...))));
|
formatted_msg));
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue