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 | 15ab2cc1596afd590aac55ef0aab6593ca64df74 (patch) | |
tree | 6dfabe9c72cae9d787286887c64b83d847ea362d | |
parent | bd94f0cb1ab82877baa4f60df8328966d1501c9e (diff) | |
download | ydb-15ab2cc1596afd590aac55ef0aab6593ca64df74.tar.gz |
Restoring authorship annotation for <ivanfefer@yandex-team.ru>. Commit 1 of 2.
-rw-r--r-- | library/cpp/logger/global/common.cpp | 8 | ||||
-rw-r--r-- | library/cpp/logger/global/common.h | 34 | ||||
-rw-r--r-- | library/cpp/logger/global/rty_formater.cpp | 8 | ||||
-rw-r--r-- | library/cpp/logger/global/rty_formater.h | 2 |
4 files changed, 26 insertions, 26 deletions
diff --git a/library/cpp/logger/global/common.cpp b/library/cpp/logger/global/common.cpp index 4fb05c19b4..b8ae53a883 100644 --- a/library/cpp/logger/global/common.cpp +++ b/library/cpp/logger/global/common.cpp @@ -23,10 +23,10 @@ namespace NLoggingImpl { } } -bool TLogFilter::CheckLoggingContext(TLog& log, const TLogRecordContext& context) { - return context.Priority <= log.FiltrationLevel(); -} - +bool TLogFilter::CheckLoggingContext(TLog& log, const TLogRecordContext& context) { + return context.Priority <= log.FiltrationLevel(); +} + TSimpleSharedPtr<TLogElement> TLogFilter::StartRecord(TLog& logger, const TLogRecordContext& context, TSimpleSharedPtr<TLogElement> earlier) { if (earlier) return earlier; diff --git a/library/cpp/logger/global/common.h b/library/cpp/logger/global/common.h index 7dcf650dec..34c0d16659 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))) diff --git a/library/cpp/logger/global/rty_formater.cpp b/library/cpp/logger/global/rty_formater.cpp index 305f8470c5..677931d478 100644 --- a/library/cpp/logger/global/rty_formater.cpp +++ b/library/cpp/logger/global/rty_formater.cpp @@ -80,10 +80,10 @@ ILoggerFormatter* CreateRtyLoggerFormatter() { return new TRtyLoggerFormatter(); } -bool TRTYMessageFormater::CheckLoggingContext(TLog& /*logger*/, const TLogRecordContext& /*context*/) { - return true; -} - +bool TRTYMessageFormater::CheckLoggingContext(TLog& /*logger*/, const TLogRecordContext& /*context*/) { + return true; +} + TSimpleSharedPtr<TLogElement> TRTYMessageFormater::StartRecord(TLog& logger, const TLogRecordContext& context, TSimpleSharedPtr<TLogElement> earlier) { if (!earlier) { earlier.Reset(new TLogElement(&logger)); diff --git a/library/cpp/logger/global/rty_formater.h b/library/cpp/logger/global/rty_formater.h index 6532e1d769..cfdb71be1d 100644 --- a/library/cpp/logger/global/rty_formater.h +++ b/library/cpp/logger/global/rty_formater.h @@ -54,7 +54,7 @@ class TLoggerFormatterOperator : public NLoggingImpl::TOperatorBase<ILoggerForma }; struct TRTYMessageFormater { - static bool CheckLoggingContext(TLog& logger, const TLogRecordContext& context); + static bool CheckLoggingContext(TLog& logger, const TLogRecordContext& context); static TSimpleSharedPtr<TLogElement> StartRecord(TLog& logger, const TLogRecordContext& context, TSimpleSharedPtr<TLogElement> earlier); }; |