diff options
| author | iddqd <[email protected]> | 2022-02-10 16:49:45 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:45 +0300 |
| commit | 07fce9c5f7771600d0b3d70e1f88fd8a7e164d85 (patch) | |
| tree | e4aa4750fbb864d70f8c06cf03d2750e979ea3bf /library/cpp/logger/thread_creator.cpp | |
| parent | af42068bf6cd93c976b80dd0388fa48cdf65da11 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 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 8f5cfe27829..7e2eaba109d 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; +} |
