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/thread_creator.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/thread_creator.cpp')
-rw-r--r-- | library/cpp/logger/thread_creator.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/library/cpp/logger/thread_creator.cpp b/library/cpp/logger/thread_creator.cpp index 7e2eaba109..8f5cfe2782 100644 --- a/library/cpp/logger/thread_creator.cpp +++ b/library/cpp/logger/thread_creator.cpp @@ -1,30 +1,30 @@ -#include "thread_creator.h" -#include "thread.h" - -TOwningThreadedLogBackendCreator::TOwningThreadedLogBackendCreator(THolder<ILogBackendCreator>&& slave) - : Slave(std::move(slave)) -{} - -THolder<TLogBackend> TOwningThreadedLogBackendCreator::DoCreateLogBackend() const { - return MakeHolder<TOwningThreadedLogBackend>(Slave->CreateLogBackend().Release(), QueueLen, QueueOverflowCallback); -} - -bool TOwningThreadedLogBackendCreator::Init(const IInitContext& ctx) { - ctx.GetValue("QueueLen", QueueLen); - return Slave->Init(ctx); -} - - -void TOwningThreadedLogBackendCreator::ToJson(NJson::TJsonValue& value) const { - value["QueueLen"] = QueueLen; - value["Threaded"] = true; - Slave->ToJson(value); -} - -void TOwningThreadedLogBackendCreator::SetQueueOverflowCallback(std::function<void()> callback) { - QueueOverflowCallback = std::move(callback); -} - -void TOwningThreadedLogBackendCreator::SetQueueLen(size_t len) { - QueueLen = len; -} +#include "thread_creator.h" +#include "thread.h" + +TOwningThreadedLogBackendCreator::TOwningThreadedLogBackendCreator(THolder<ILogBackendCreator>&& slave) + : Slave(std::move(slave)) +{} + +THolder<TLogBackend> TOwningThreadedLogBackendCreator::DoCreateLogBackend() const { + return MakeHolder<TOwningThreadedLogBackend>(Slave->CreateLogBackend().Release(), QueueLen, QueueOverflowCallback); +} + +bool TOwningThreadedLogBackendCreator::Init(const IInitContext& ctx) { + ctx.GetValue("QueueLen", QueueLen); + return Slave->Init(ctx); +} + + +void TOwningThreadedLogBackendCreator::ToJson(NJson::TJsonValue& value) const { + value["QueueLen"] = QueueLen; + value["Threaded"] = true; + Slave->ToJson(value); +} + +void TOwningThreadedLogBackendCreator::SetQueueOverflowCallback(std::function<void()> callback) { + QueueOverflowCallback = std::move(callback); +} + +void TOwningThreadedLogBackendCreator::SetQueueLen(size_t len) { + QueueLen = len; +} |