/
githubmirror
/
nbs
Обзор
Документация
Войти
/
githubmirror
/
nbs
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
library/cpp/logger/rotating_file_creator.cpp
28 строк
971 B
qkrorlqr
Initial NBS OpenSource export
28 апр 2023, 21:54
28 апр 2023, 21:54
783a858
Код
Авторство
О чём код?
#include "rotating_file_creator.h" #include "rotating_file.h" THolder<TLogBackend> TRotatingFileLogBackendCreator::DoCreateLogBackend() const { return MakeHolder<TRotatingFileLogBackend>(Path, MaxSizeBytes, RotatedFilesCount); } TRotatingFileLogBackendCreator::TRotatingFileLogBackendCreator() : TFileLogBackendCreator("", "rotating") {} bool TRotatingFileLogBackendCreator::Init(const IInitContext& ctx) { if (!TFileLogBackendCreator::Init(ctx)) { return false; } ctx.GetValue("MaxSizeBytes", MaxSizeBytes); ctx.GetValue("RotatedFilesCount", RotatedFilesCount); return true; } ILogBackendCreator::TFactory::TRegistrator<TRotatingFileLogBackendCreator> TRotatingFileLogBackendCreator::Registrar("rotating"); void TRotatingFileLogBackendCreator::DoToJson(NJson::TJsonValue& value) const { TFileLogBackendCreator::DoToJson(value); value["MaxSizeBytes"] = MaxSizeBytes; value["RotatedFilesCount"] = RotatedFilesCount; }