aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/logger/system_creator.cpp
blob: e1cd02d42254e34e6a8e71f0dc099abe608b7af9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "system_creator.h"

THolder<TLogBackend> TSysLogBackendCreator::DoCreateLogBackend() const {
    return MakeHolder<TSysLogBackend>(Ident.c_str(), Facility, Flags);
}


TSysLogBackendCreator::TSysLogBackendCreator()
    : TLogBackendCreatorBase("system")
{}

bool TSysLogBackendCreator::Init(const IInitContext& ctx) {
    ctx.GetValue("Ident", Ident);
    ctx.GetValue("Facility", (int&)Facility);
    ctx.GetValue("Flags", Flags);
    return true;
}

ILogBackendCreator::TFactory::TRegistrator<TSysLogBackendCreator> TSysLogBackendCreator::Registrar("system");

void TSysLogBackendCreator::DoToJson(NJson::TJsonValue& value) const {
    value["Ident"] = Ident;
    value["Facility"] = (int&)Facility;
    value["Flags"] = Flags;
}