Lockless return when no loggers are registered

This commit is contained in:
Jack Andersen 2017-11-18 21:07:26 -10:00
parent f8ab0e03ba
commit f20a62749e
1 changed files with 4 additions and 0 deletions

View File

@ -173,6 +173,8 @@ public:
template <typename CharType> template <typename CharType>
inline void report(Level severity, const CharType* format, ...) inline void report(Level severity, const CharType* format, ...)
{ {
if (MainLoggers.empty() && severity != Level::Fatal)
return;
va_list ap; va_list ap;
va_start(ap, format); va_start(ap, format);
report(severity, format, ap); report(severity, format, ap);
@ -208,6 +210,8 @@ public:
template <typename CharType> template <typename CharType>
inline void reportSource(Level severity, const char* file, unsigned linenum, const CharType* format, ...) inline void reportSource(Level severity, const char* file, unsigned linenum, const CharType* format, ...)
{ {
if (MainLoggers.empty() && severity != Level::Fatal)
return;
va_list ap; va_list ap;
va_start(ap, format); va_start(ap, format);
reportSource(severity, file, linenum, format, ap); reportSource(severity, file, linenum, format, ap);