aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/logging.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2024-12-02 12:21:53 +0100
committerGitHub Enterprise <[email protected]>2024-12-02 12:21:53 +0100
commite6f44577f469e891ed8dab1492a4c53224e0b765 (patch)
tree47334606ce62fb6bf1975cdc09276ced335599f4 /src/zencore/logging.cpp
parent5.5.15-pre0 (diff)
downloadzen-e6f44577f469e891ed8dab1492a4c53224e0b765.tar.xz
zen-e6f44577f469e891ed8dab1492a4c53224e0b765.zip
added support for dynamic LLM tags (#245)
* added FLLMTag which can be used to register memory tags outside of core * changed `UE_MEMSCOPE` -> `ZEN_MEMSCOPE` for consistency * instrumented some subsystems with dynamic tags
Diffstat (limited to 'src/zencore/logging.cpp')
-rw-r--r--src/zencore/logging.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/zencore/logging.cpp b/src/zencore/logging.cpp
index 7bd500b3b..5885587ad 100644
--- a/src/zencore/logging.cpp
+++ b/src/zencore/logging.cpp
@@ -68,7 +68,7 @@ static_assert(offsetof(spdlog::source_loc, funcname) == offsetof(SourceLocation,
void
EmitLogMessage(LoggerRef& Logger, int LogLevel, const std::string_view Message)
{
- UE_MEMSCOPE(ELLMTag::Logging);
+ ZEN_MEMSCOPE(ELLMTag::Logging);
const spdlog::level::level_enum InLevel = (spdlog::level::level_enum)LogLevel;
Logger.SpdLogger->log(InLevel, Message);
if (IsErrorLevel(LogLevel))
@@ -83,7 +83,7 @@ EmitLogMessage(LoggerRef& Logger, int LogLevel, const std::string_view Message)
void
EmitLogMessage(LoggerRef& Logger, int LogLevel, std::string_view Format, fmt::format_args Args)
{
- UE_MEMSCOPE(ELLMTag::Logging);
+ ZEN_MEMSCOPE(ELLMTag::Logging);
zen::logging::LoggingContext LogCtx;
fmt::vformat_to(fmt::appender(LogCtx.MessageBuffer), Format, Args);
zen::logging::EmitLogMessage(Logger, LogLevel, LogCtx.Message());
@@ -92,7 +92,7 @@ EmitLogMessage(LoggerRef& Logger, int LogLevel, std::string_view Format, fmt::fo
void
EmitLogMessage(LoggerRef& Logger, const SourceLocation& InLocation, int LogLevel, const std::string_view Message)
{
- UE_MEMSCOPE(ELLMTag::Logging);
+ ZEN_MEMSCOPE(ELLMTag::Logging);
const spdlog::source_loc& Location = *reinterpret_cast<const spdlog::source_loc*>(&InLocation);
const spdlog::level::level_enum InLevel = (spdlog::level::level_enum)LogLevel;
Logger.SpdLogger->log(Location, InLevel, Message);
@@ -108,7 +108,7 @@ EmitLogMessage(LoggerRef& Logger, const SourceLocation& InLocation, int LogLevel
void
EmitLogMessage(LoggerRef& Logger, const SourceLocation& InLocation, int LogLevel, std::string_view Format, fmt::format_args Args)
{
- UE_MEMSCOPE(ELLMTag::Logging);
+ ZEN_MEMSCOPE(ELLMTag::Logging);
zen::logging::LoggingContext LogCtx;
fmt::vformat_to(fmt::appender(LogCtx.MessageBuffer), Format, Args);
zen::logging::EmitLogMessage(Logger, InLocation, LogLevel, LogCtx.Message());
@@ -117,7 +117,7 @@ EmitLogMessage(LoggerRef& Logger, const SourceLocation& InLocation, int LogLevel
void
EmitConsoleLogMessage(int LogLevel, const std::string_view Message)
{
- UE_MEMSCOPE(ELLMTag::Logging);
+ ZEN_MEMSCOPE(ELLMTag::Logging);
const spdlog::level::level_enum InLevel = (spdlog::level::level_enum)LogLevel;
ConsoleLog().SpdLogger->log(InLevel, Message);
}
@@ -125,7 +125,7 @@ EmitConsoleLogMessage(int LogLevel, const std::string_view Message)
void
EmitConsoleLogMessage(int LogLevel, std::string_view Format, fmt::format_args Args)
{
- UE_MEMSCOPE(ELLMTag::Logging);
+ ZEN_MEMSCOPE(ELLMTag::Logging);
zen::logging::LoggingContext LogCtx;
fmt::vformat_to(fmt::appender(LogCtx.MessageBuffer), Format, Args);
zen::logging::EmitConsoleLogMessage(LogLevel, LogCtx.Message());
@@ -200,7 +200,7 @@ std::string LogLevels[level::LogLevelCount];
void
ConfigureLogLevels(level::LogLevel Level, std::string_view Loggers)
{
- UE_MEMSCOPE(ELLMTag::Logging);
+ ZEN_MEMSCOPE(ELLMTag::Logging);
RwLock::ExclusiveLockScope _(LogLevelsLock);
LogLevels[Level] = Loggers;
@@ -209,7 +209,7 @@ ConfigureLogLevels(level::LogLevel Level, std::string_view Loggers)
void
RefreshLogLevels(level::LogLevel* DefaultLevel)
{
- UE_MEMSCOPE(ELLMTag::Logging);
+ ZEN_MEMSCOPE(ELLMTag::Logging);
spdlog::details::registry::log_levels Levels;
@@ -287,7 +287,7 @@ Default()
void
SetDefault(std::string_view NewDefaultLoggerId)
{
- UE_MEMSCOPE(ELLMTag::Logging);
+ ZEN_MEMSCOPE(ELLMTag::Logging);
auto NewDefaultLogger = spdlog::get(std::string(NewDefaultLoggerId));
ZEN_ASSERT(NewDefaultLogger);
@@ -307,7 +307,7 @@ ErrorLog()
void
SetErrorLog(std::string_view NewErrorLoggerId)
{
- UE_MEMSCOPE(ELLMTag::Logging);
+ ZEN_MEMSCOPE(ELLMTag::Logging);
if (NewErrorLoggerId.empty())
{
@@ -326,7 +326,7 @@ SetErrorLog(std::string_view NewErrorLoggerId)
LoggerRef
Get(std::string_view Name)
{
- UE_MEMSCOPE(ELLMTag::Logging);
+ ZEN_MEMSCOPE(ELLMTag::Logging);
std::shared_ptr<spdlog::logger> Logger = spdlog::get(std::string(Name));
@@ -357,7 +357,7 @@ SuppressConsoleLog()
LoggerRef
ConsoleLog()
{
- UE_MEMSCOPE(ELLMTag::Logging);
+ ZEN_MEMSCOPE(ELLMTag::Logging);
std::call_once(ConsoleInitFlag, [&] {
if (!ConLogger)
@@ -375,7 +375,7 @@ ConsoleLog()
void
InitializeLogging()
{
- UE_MEMSCOPE(ELLMTag::Logging);
+ ZEN_MEMSCOPE(ELLMTag::Logging);
TheDefaultLogger = *spdlog::default_logger_raw();
}