diff options
author | ivanfefer <ivanfefer@yandex-team.ru> | 2022-02-10 16:50:13 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:13 +0300 |
commit | 9f848110233b3807d5dd3ae5479b3957d791892c (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/logger/global/common.h | |
parent | 15ab2cc1596afd590aac55ef0aab6593ca64df74 (diff) | |
download | ydb-9f848110233b3807d5dd3ae5479b3957d791892c.tar.gz |
Restoring authorship annotation for <ivanfefer@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/logger/global/common.h')
-rw-r--r-- | library/cpp/logger/global/common.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/logger/global/common.h b/library/cpp/logger/global/common.h index 34c0d16659..7dcf650dec 100644 --- a/library/cpp/logger/global/common.h +++ b/library/cpp/logger/global/common.h @@ -94,12 +94,12 @@ struct TLogRecordPreprocessor; template <> struct TLogRecordPreprocessor<> { - inline static bool CheckLoggingContext(TLog& /*log*/, const TLogRecordContext& /*context*/) { - return true; - } - + inline static bool CheckLoggingContext(TLog& /*log*/, const TLogRecordContext& /*context*/) { + return true; + } + inline static TSimpleSharedPtr<TLogElement> StartRecord(TLog& log, const TLogRecordContext& context, TSimpleSharedPtr<TLogElement> earlier) { - if (earlier) + if (earlier) return earlier; TSimpleSharedPtr<TLogElement> result(new TLogElement(&log)); *result << context.Priority; @@ -109,10 +109,10 @@ struct TLogRecordPreprocessor<> { template <class H, class... R> struct TLogRecordPreprocessor<H, R...> { - inline static bool CheckLoggingContext(TLog& log, const TLogRecordContext& context) { - return H::CheckLoggingContext(log, context) && TLogRecordPreprocessor<R...>::CheckLoggingContext(log, context); - } - + inline static bool CheckLoggingContext(TLog& log, const TLogRecordContext& context) { + return H::CheckLoggingContext(log, context) && TLogRecordPreprocessor<R...>::CheckLoggingContext(log, context); + } + inline static TSimpleSharedPtr<TLogElement> StartRecord(TLog& log, const TLogRecordContext& context, TSimpleSharedPtr<TLogElement> earlier) { TSimpleSharedPtr<TLogElement> first = H::StartRecord(log, context, earlier); return TLogRecordPreprocessor<R...>::StartRecord(log, context, first); @@ -120,8 +120,8 @@ struct TLogRecordPreprocessor<H, R...> { }; struct TLogFilter { - static bool CheckLoggingContext(TLog& log, const TLogRecordContext& context); - static TSimpleSharedPtr<TLogElement> StartRecord(TLog& log, const TLogRecordContext& context, TSimpleSharedPtr<TLogElement> earlier); + static bool CheckLoggingContext(TLog& log, const TLogRecordContext& context); + static TSimpleSharedPtr<TLogElement> StartRecord(TLog& log, const TLogRecordContext& context, TSimpleSharedPtr<TLogElement> earlier); }; class TNullLog; @@ -133,14 +133,14 @@ TSimpleSharedPtr<TLogElement> GetLoggerForce(TLog& log, const TLogRecordContext& return new TLogElement(&TLoggerOperator<TNullLog>::Log()); } -namespace NPrivateGlobalLogger { - struct TEatStream { +namespace NPrivateGlobalLogger { + struct TEatStream { Y_FORCE_INLINE bool operator|(const IOutputStream&) const { - return true; - } - }; + 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))) |