diff options
author | conterouz <conterouz@yandex-team.com> | 2023-11-13 11:26:20 +0300 |
---|---|---|
committer | conterouz <conterouz@yandex-team.com> | 2023-11-13 11:59:03 +0300 |
commit | dab0d384d5e9c65b0d7f467bc3e21728cd179ba3 (patch) | |
tree | 4d8d26afd0fe64a781e55200a0c252ee5050dcde | |
parent | 0ab35f35d6fdca04b22724fceb9f98ee976b7891 (diff) | |
download | ydb-dab0d384d5e9c65b0d7f467bc3e21728cd179ba3.tar.gz |
Сделать нормальное логгирование в UaaS
-rw-r--r-- | library/cpp/logger/composite.cpp | 1 | ||||
-rw-r--r-- | library/cpp/logger/composite.h | 1 | ||||
-rw-r--r-- | library/cpp/logger/log.h | 3 |
3 files changed, 5 insertions, 0 deletions
diff --git a/library/cpp/logger/composite.cpp b/library/cpp/logger/composite.cpp index 3ce0154ced..eae7565a1b 100644 --- a/library/cpp/logger/composite.cpp +++ b/library/cpp/logger/composite.cpp @@ -14,5 +14,6 @@ void TCompositeLogBackend::ReopenLog() { } void TCompositeLogBackend::AddLogBackend(THolder<TLogBackend>&& backend) { + LogPriority = Max(LogPriority, backend->FiltrationLevel()); Slaves.emplace_back(std::move(backend)); } diff --git a/library/cpp/logger/composite.h b/library/cpp/logger/composite.h index 142c61b8d5..47f3558b75 100644 --- a/library/cpp/logger/composite.h +++ b/library/cpp/logger/composite.h @@ -11,4 +11,5 @@ public: private: TVector<THolder<TLogBackend>> Slaves; + ELogPriority LogPriority = static_cast<ELogPriority>(0); // has now it's own priority by default }; diff --git a/library/cpp/logger/log.h b/library/cpp/logger/log.h index 7520cc1530..6c90b0cb29 100644 --- a/library/cpp/logger/log.h +++ b/library/cpp/logger/log.h @@ -54,6 +54,9 @@ public: // Check if underlying backend is defined and is not null. // NOTE: not thread safe with respect to `ResetBackend` and `ReleaseBackend`. bool IsNullLog() const noexcept; + bool IsNotNullLog() const noexcept { + return !IsNullLog(); + } // Write message to the log. // |