From e6f44577f469e891ed8dab1492a4c53224e0b765 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Mon, 2 Dec 2024 12:21:53 +0100 Subject: 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 --- src/zenutil/include/zenutil/logging/rotatingfilesink.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/zenutil/include') diff --git a/src/zenutil/include/zenutil/logging/rotatingfilesink.h b/src/zenutil/include/zenutil/logging/rotatingfilesink.h index ca4649ba8..e01b86cb7 100644 --- a/src/zenutil/include/zenutil/logging/rotatingfilesink.h +++ b/src/zenutil/include/zenutil/logging/rotatingfilesink.h @@ -2,6 +2,7 @@ #pragma once +#include #include ZEN_THIRD_PARTY_INCLUDES_START @@ -24,6 +25,7 @@ public: , m_MaxSize(MaxSize) , m_MaxFiles(MaxFiles) { + ZEN_MEMSCOPE(ELLMTag::Logging); std::error_code Ec; if (RotateOnOpen) { @@ -73,6 +75,8 @@ public: virtual void log(const spdlog::details::log_msg& msg) override { + ZEN_MEMSCOPE(ELLMTag::Logging); + try { spdlog::memory_buf_t Formatted; @@ -108,6 +112,8 @@ public: } virtual void flush() override { + ZEN_MEMSCOPE(ELLMTag::Logging); + try { RwLock::SharedLockScope Lock(m_Lock); @@ -124,6 +130,8 @@ public: virtual void set_pattern(const std::string& pattern) override { + ZEN_MEMSCOPE(ELLMTag::Logging); + try { RwLock::ExclusiveLockScope _(m_Lock); @@ -136,6 +144,8 @@ public: } virtual void set_formatter(std::unique_ptr sink_formatter) override { + ZEN_MEMSCOPE(ELLMTag::Logging); + try { RwLock::ExclusiveLockScope _(m_Lock); @@ -150,6 +160,8 @@ public: private: void Rotate(RwLock::ExclusiveLockScope&, std::error_code& OutEc) { + ZEN_MEMSCOPE(ELLMTag::Logging); + m_CurrentFile.Close(); OutEc = RotateFiles(m_BaseFilename, m_MaxFiles); @@ -170,6 +182,8 @@ private: bool TrySinkIt(const spdlog::details::log_msg& msg, spdlog::memory_buf_t& OutFormatted) { + ZEN_MEMSCOPE(ELLMTag::Logging); + RwLock::SharedLockScope Lock(m_Lock); if (!m_CurrentFile.IsOpen()) { @@ -193,6 +207,8 @@ private: bool TrySinkIt(const spdlog::memory_buf_t& Formatted) { + ZEN_MEMSCOPE(ELLMTag::Logging); + RwLock::SharedLockScope Lock(m_Lock); if (!m_CurrentFile.IsOpen()) { -- cgit v1.2.3