mirror of
https://github.com/AxioDL/logvisor.git
synced 2025-12-08 13:15:09 +00:00
Lockless return when no loggers are registered
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user