[ox/std] Make logError inline

This commit is contained in:
Gary Talent 2021-07-29 22:24:46 -05:00
parent cc5cc01e70
commit 5d5198bf4c
2 changed files with 9 additions and 11 deletions

View File

@ -10,16 +10,6 @@
namespace ox::trace {
void logError(const char *file, int line, const Error &err) {
if (err) {
TraceStream trc(file, line, "ox::error");
trc << "Error:" << err;
if (err.file != nullptr) {
trc << "(" << err.file << ":" << err.line << ")";
}
}
}
void init() {
oxTraceInitHook();
}

View File

@ -257,7 +257,15 @@ using TraceStream = OutStream;
using TraceStream = NullStream;
#endif
void logError(const char *file, int line, const Error &err);
inline void logError(const char *file, int line, const Error &err) noexcept {
if (err) {
TraceStream trc(file, line, "ox::error");
trc << "Error:" << err;
if (err.file != nullptr) {
trc << "(" << err.file << ":" << err.line << ")";
}
}
}
void init();