Skip to content

Commit

Permalink
Allow to call logger function before initializing logger service.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolftein committed Feb 11, 2024
1 parent a75adaf commit 3cefcba
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions Source/Public/Core/Log/Service.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,27 @@ namespace Log
};

// -=(Undocumented)=-
#define LOG_DEBUG(Format, ...) \
QUILL_LOG_DEBUG(Log::Service::GetSingleton().GetLogger(), Format, ##__VA_ARGS__)
#define LOG_DEBUG(Format, ...) \
if (Log::Service::GetSingleton().GetLogger()) \
QUILL_LOG_DEBUG(Log::Service::GetSingleton().GetLogger(), Format, ##__VA_ARGS__)

// -=(Undocumented)=-
#define LOG_INFO(Format, ...) \
QUILL_LOG_INFO(Log::Service::GetSingleton().GetLogger(), Format, ##__VA_ARGS__)
#define LOG_INFO(Format, ...) \
if (Log::Service::GetSingleton().GetLogger()) \
QUILL_LOG_INFO(Log::Service::GetSingleton().GetLogger(), Format, ##__VA_ARGS__)

// -=(Undocumented)=-
#define LOG_WARNING(Format, ...) \
QUILL_LOG_WARNING(Log::Service::GetSingleton().GetLogger(), Format, ##__VA_ARGS__)
#define LOG_WARNING(Format, ...) \
if (Log::Service::GetSingleton().GetLogger()) \
QUILL_LOG_WARNING(Log::Service::GetSingleton().GetLogger(), Format, ##__VA_ARGS__)

// -=(Undocumented)=-
#define LOG_ERROR(Format, ...) \
QUILL_LOG_ERROR(Log::Service::GetSingleton().GetLogger(), Format, ##__VA_ARGS__)
#define LOG_ERROR(Format, ...) \
if (Log::Service::GetSingleton().GetLogger()) \
QUILL_LOG_ERROR(Log::Service::GetSingleton().GetLogger(), Format, ##__VA_ARGS__)

// -=(Undocumented)=-
#define LOG_CRITICAL(Format, ...) \
QUILL_LOG_CRITICAL(Log::Service::GetSingleton().GetLogger(), Format, ##__VA_ARGS__)
#define LOG_CRITICAL(Format, ...) \
if (Log::Service::GetSingleton().GetLogger()) \
QUILL_LOG_CRITICAL(Log::Service::GetSingleton().GetLogger(), Format, ##__VA_ARGS__)
}

0 comments on commit 3cefcba

Please sign in to comment.