diff options
author | iddqd <iddqd@yandex-team.ru> | 2022-02-10 16:49:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:46 +0300 |
commit | ff241e1daf76d79ed38015cdb76d55eb3a33ac27 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/logger/global/common.cpp | |
parent | 07fce9c5f7771600d0b3d70e1f88fd8a7e164d85 (diff) | |
download | ydb-ff241e1daf76d79ed38015cdb76d55eb3a33ac27.tar.gz |
Restoring authorship annotation for <iddqd@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/logger/global/common.cpp')
-rw-r--r-- | library/cpp/logger/global/common.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/library/cpp/logger/global/common.cpp b/library/cpp/logger/global/common.cpp index 9cfd1b0386..4fb05c19b4 100644 --- a/library/cpp/logger/global/common.cpp +++ b/library/cpp/logger/global/common.cpp @@ -1,12 +1,12 @@ #include "common.h" - + #include <util/generic/yexception.h> -namespace NLoggingImpl { +namespace NLoggingImpl { TString GetLocalTimeSSimple() { - struct tm tm; - return Strftime("%b%d_%H%M%S", Now().LocalTime(&tm)); - } + struct tm tm; + return Strftime("%b%d_%H%M%S", Now().LocalTime(&tm)); + } TString PrepareToOpenLog(TString logType, const int logLevel, const bool rotation, const bool startAsDaemon) { Y_ENSURE(logLevel >= 0 && logLevel <= (int)LOG_MAX_PRIORITY, "Incorrect log level"); @@ -21,16 +21,16 @@ namespace NLoggingImpl { return logType; } -} - +} + 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; - TSimpleSharedPtr<TLogElement> result(new TLogElement(&logger)); - *result << context.Priority; - return result; -} +TSimpleSharedPtr<TLogElement> TLogFilter::StartRecord(TLog& logger, const TLogRecordContext& context, TSimpleSharedPtr<TLogElement> earlier) { + if (earlier) + return earlier; + TSimpleSharedPtr<TLogElement> result(new TLogElement(&logger)); + *result << context.Priority; + return result; +} |