aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/logger/file_creator.cpp
blob: 28071710171c3714cd2729f59a5fc6edde643a39 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#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; 
}