diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/logger/global | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/logger/global')
-rw-r--r-- | library/cpp/logger/global/common.h | 8 | ||||
-rw-r--r-- | library/cpp/logger/global/global.cpp | 4 | ||||
-rw-r--r-- | library/cpp/logger/global/global.h | 10 | ||||
-rw-r--r-- | library/cpp/logger/global/rty_formater.cpp | 4 | ||||
-rw-r--r-- | library/cpp/logger/global/rty_formater.h | 2 | ||||
-rw-r--r-- | library/cpp/logger/global/rty_formater_ut.cpp | 2 |
6 files changed, 15 insertions, 15 deletions
diff --git a/library/cpp/logger/global/common.h b/library/cpp/logger/global/common.h index 0f5b9893c6..7dcf650dec 100644 --- a/library/cpp/logger/global/common.h +++ b/library/cpp/logger/global/common.h @@ -36,7 +36,7 @@ namespace NLoggingImpl { public: inline static bool Usage() { return SingletonWithPriority<TPtr, SingletonPriority>()->Instance.Get(); - } + } inline static T* Get() { return SingletonWithPriority<TPtr, SingletonPriority>()->Instance.Get(); @@ -139,11 +139,11 @@ namespace NPrivateGlobalLogger { return true; } }; -} +} #define LOGGER_GENERIC_LOG_CHECKED(logger, preprocessor, level, message) (*GetLoggerForce<preprocessor>(logger, TLogRecordContext(__LOCATION__, message, level))) -#define LOGGER_CHECKED_GENERIC_LOG(logger, preprocessor, level, message) \ - (preprocessor::CheckLoggingContext(logger, TLogRecordContext(__LOCATION__, message, level))) && NPrivateGlobalLogger::TEatStream() | (*(preprocessor::StartRecord(logger, TLogRecordContext(__LOCATION__, message, level), nullptr))) +#define LOGGER_CHECKED_GENERIC_LOG(logger, preprocessor, level, message) \ + (preprocessor::CheckLoggingContext(logger, TLogRecordContext(__LOCATION__, message, level))) && NPrivateGlobalLogger::TEatStream() | (*(preprocessor::StartRecord(logger, TLogRecordContext(__LOCATION__, message, level), nullptr))) #define SINGLETON_GENERIC_LOG_CHECKED(type, preprocessor, level, message) LOGGER_GENERIC_LOG_CHECKED(TLoggerOperator<type>::Log(), preprocessor, level, message) #define SINGLETON_CHECKED_GENERIC_LOG(type, preprocessor, level, message) LOGGER_CHECKED_GENERIC_LOG(TLoggerOperator<type>::Log(), preprocessor, level, message) diff --git a/library/cpp/logger/global/global.cpp b/library/cpp/logger/global/global.cpp index d871fcd350..9fbd10f666 100644 --- a/library/cpp/logger/global/global.cpp +++ b/library/cpp/logger/global/global.cpp @@ -26,12 +26,12 @@ bool GlobalLogInitialized() { return TLoggerOperator<TGlobalLog>::Usage(); } -template <> +template <> TGlobalLog* CreateDefaultLogger<TGlobalLog>() { return new TGlobalLog("console", TLOG_INFO); } -template <> +template <> TNullLog* CreateDefaultLogger<TNullLog>() { return new TNullLog("null"); } diff --git a/library/cpp/logger/global/global.h b/library/cpp/logger/global/global.h index 0613709ff0..cbe71b16ea 100644 --- a/library/cpp/logger/global/global.h +++ b/library/cpp/logger/global/global.h @@ -30,7 +30,7 @@ public: } }; -template <> +template <> TGlobalLog* CreateDefaultLogger<TGlobalLog>(); class TNullLog: public TLog { @@ -46,7 +46,7 @@ public: } }; -template <> +template <> TNullLog* CreateDefaultLogger<TNullLog>(); template <> @@ -79,9 +79,9 @@ public: #define VERIFY_WITH_LOG(expr, msg, ...) \ do { \ - if (Y_UNLIKELY(!(expr))) { \ + if (Y_UNLIKELY(!(expr))) { \ FATAL_LOG << Sprintf(msg, ##__VA_ARGS__) << Endl; \ - Y_VERIFY(false, msg, ##__VA_ARGS__); \ + Y_VERIFY(false, msg, ##__VA_ARGS__); \ }; \ } while (0); @@ -90,7 +90,7 @@ namespace NPrivateGlobalLogger { public: ~TVerifyEvent(); template <class T> - inline TVerifyEvent& operator<<(const T& t) { + inline TVerifyEvent& operator<<(const T& t) { static_cast<IOutputStream&>(*this) << t; return *this; diff --git a/library/cpp/logger/global/rty_formater.cpp b/library/cpp/logger/global/rty_formater.cpp index c7799280bd..305f8470c5 100644 --- a/library/cpp/logger/global/rty_formater.cpp +++ b/library/cpp/logger/global/rty_formater.cpp @@ -18,7 +18,7 @@ namespace { instant.LocalTime(&tm); // both stftime and sprintf exclude the terminating null byte from the return value - char* pos = begin; + char* pos = begin; pos += strftime(pos, end - pos, "%Y-%m-%d %H:%M:%S.", &tm); pos += sprintf(pos, "%03" PRIu32, instant.MilliSecondsOfSecond()); pos += strftime(pos, end - pos, " %z", &tm); @@ -28,7 +28,7 @@ namespace { } namespace NLoggingImpl { - IOutputStream& operator<<(IOutputStream& out, TLocalTimeS localTimeS) { + IOutputStream& operator<<(IOutputStream& out, TLocalTimeS localTimeS) { char buffer[LocalTimeSBufferSize]; size_t len = PrintLocalTimeS(localTimeS.GetInstant(), buffer, buffer + sizeof(buffer)); out.Write(buffer, len); diff --git a/library/cpp/logger/global/rty_formater.h b/library/cpp/logger/global/rty_formater.h index cf58bb7949..6532e1d769 100644 --- a/library/cpp/logger/global/rty_formater.h +++ b/library/cpp/logger/global/rty_formater.h @@ -1,5 +1,5 @@ #pragma once - + #include "common.h" namespace NMemInfo { diff --git a/library/cpp/logger/global/rty_formater_ut.cpp b/library/cpp/logger/global/rty_formater_ut.cpp index c5d4461ae7..551a97c5bf 100644 --- a/library/cpp/logger/global/rty_formater_ut.cpp +++ b/library/cpp/logger/global/rty_formater_ut.cpp @@ -26,6 +26,6 @@ Y_UNIT_TEST_SUITE(NLoggingImplTest) { Y_UNIT_TEST(TestTLocalTimeSAddRight) { NLoggingImpl::TLocalTimeS lt(TInstant::ParseIso8601Deprecated(SampleISO8601)); TString prefix("prefix"); - UNIT_ASSERT_EQUAL(prefix + lt, prefix + SampleRtyLog); + UNIT_ASSERT_EQUAL(prefix + lt, prefix + SampleRtyLog); } } |