diff options
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 7e2eaba109d..8f5cfe27829 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; +} |
