diff options
author | trofimenkov <trofimenkov@yandex-team.ru> | 2022-02-10 16:49:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:30 +0300 |
commit | 30cebc2cfa79af3b577760a113e203a79450e6b6 (patch) | |
tree | 49327bf3c28fab534b04b312a39179e70f7c2763 /library/cpp/logger | |
parent | a2d2743094c8d255cda4011b317235874db4d01c (diff) | |
download | ydb-30cebc2cfa79af3b577760a113e203a79450e6b6.tar.gz |
Restoring authorship annotation for <trofimenkov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/logger')
-rw-r--r-- | library/cpp/logger/element.cpp | 10 | ||||
-rw-r--r-- | library/cpp/logger/element_ut.cpp | 64 | ||||
-rw-r--r-- | library/cpp/logger/thread.cpp | 2 | ||||
-rw-r--r-- | library/cpp/logger/ut/ya.make | 2 |
4 files changed, 39 insertions, 39 deletions
diff --git a/library/cpp/logger/element.cpp b/library/cpp/logger/element.cpp index b510fe16e1..e39b4607bf 100644 --- a/library/cpp/logger/element.cpp +++ b/library/cpp/logger/element.cpp @@ -2,7 +2,7 @@ #include "element.h" #include <utility> - + TLogElement::TLogElement(const TLog* parent) : Parent_(parent) , Priority_(Parent_->DefaultPriority()) @@ -25,10 +25,10 @@ TLogElement::~TLogElement() { } void TLogElement::DoFlush() { - if (IsNull()) { - return; - } - + if (IsNull()) { + return; + } + const size_t filled = Filled(); if (filled) { diff --git a/library/cpp/logger/element_ut.cpp b/library/cpp/logger/element_ut.cpp index 32edc52dfb..fa7fa835bf 100644 --- a/library/cpp/logger/element_ut.cpp +++ b/library/cpp/logger/element_ut.cpp @@ -1,39 +1,39 @@ -#include "log.h" -#include "element.h" -#include "stream.h" - +#include "log.h" +#include "element.h" +#include "stream.h" + #include <util/generic/string.h> -#include <util/stream/str.h> -#include <util/generic/ptr.h> +#include <util/stream/str.h> +#include <util/generic/ptr.h> #include <utility> - + #include <library/cpp/testing/unittest/registar.h> - -class TLogElementTest: public TTestBase { - UNIT_TEST_SUITE(TLogElementTest); - UNIT_TEST(TestMoveCtor); - UNIT_TEST_SUITE_END(); - -public: - void TestMoveCtor(); -}; - -UNIT_TEST_SUITE_REGISTRATION(TLogElementTest); - -void TLogElementTest::TestMoveCtor() { - TStringStream output; + +class TLogElementTest: public TTestBase { + UNIT_TEST_SUITE(TLogElementTest); + UNIT_TEST(TestMoveCtor); + UNIT_TEST_SUITE_END(); + +public: + void TestMoveCtor(); +}; + +UNIT_TEST_SUITE_REGISTRATION(TLogElementTest); + +void TLogElementTest::TestMoveCtor() { + TStringStream output; TLog log(MakeHolder<TStreamLogBackend>(&output)); - + THolder<TLogElement> src = MakeHolder<TLogElement>(&log); - + TString message = "Hello, World!"; - (*src) << message; - + (*src) << message; + THolder<TLogElement> dst = MakeHolder<TLogElement>(std::move(*src)); - - src.Destroy(); - UNIT_ASSERT(output.Str() == ""); - - dst.Destroy(); - UNIT_ASSERT(output.Str() == message); -} + + src.Destroy(); + UNIT_ASSERT(output.Str() == ""); + + dst.Destroy(); + UNIT_ASSERT(output.Str() == message); +} diff --git a/library/cpp/logger/thread.cpp b/library/cpp/logger/thread.cpp index 0ccf9e374b..afda2404f5 100644 --- a/library/cpp/logger/thread.cpp +++ b/library/cpp/logger/thread.cpp @@ -112,7 +112,7 @@ public: private: TLogBackend* Slave_; - TThreadPool Queue_{"ThreadedLogBack"}; + TThreadPool Queue_{"ThreadedLogBack"}; const std::function<void()> QueueOverflowCallback_; }; diff --git a/library/cpp/logger/ut/ya.make b/library/cpp/logger/ut/ya.make index 2a461c1353..3e990ab8d2 100644 --- a/library/cpp/logger/ut/ya.make +++ b/library/cpp/logger/ut/ya.make @@ -12,7 +12,7 @@ SRCDIR(library/cpp/logger) SRCS( log_ut.cpp - element_ut.cpp + element_ut.cpp rotating_file_ut.cpp composite_ut.cpp ) |