aboutsummaryrefslogblamecommitdiffstats
path: root/library/cpp/logger/file_creator.cpp
blob: 0a84469e43b0fca4b22f4b6de0f9a8b1af7bdbac (plain) (tree)




















                                                                                                                     
#include "file_creator.h"
#include "file.h"

TFileLogBackendCreator::TFileLogBackendCreator(const TString& path /*= TString()*/, const TString& type /*= "file"*/)
    : TLogBackendCreatorBase(type)
    , Path(path)
{}

THolder<TLogBackend> TFileLogBackendCreator::DoCreateLogBackend() const {
    return MakeHolder<TFileLogBackend>(Path);
}

bool TFileLogBackendCreator::Init(const IInitContext& ctx) {
    ctx.GetValue("Path", Path);
    return !!Path;
}

ILogBackendCreator::TFactory::TRegistrator<TFileLogBackendCreator> TFileLogBackendCreator::Registrar("file");

void TFileLogBackendCreator::DoToJson(NJson::TJsonValue& value) const {
    value["Path"] = Path;
}