system_creator.cpp 741 B

12345678910111213141516171819202122232425
  1. #include "system_creator.h"
  2. THolder<TLogBackend> TSysLogBackendCreator::DoCreateLogBackend() const {
  3. return MakeHolder<TSysLogBackend>(Ident.c_str(), Facility, Flags);
  4. }
  5. TSysLogBackendCreator::TSysLogBackendCreator()
  6. : TLogBackendCreatorBase("system")
  7. {}
  8. bool TSysLogBackendCreator::Init(const IInitContext& ctx) {
  9. ctx.GetValue("Ident", Ident);
  10. ctx.GetValue("Facility", (int&)Facility);
  11. ctx.GetValue("Flags", Flags);
  12. return true;
  13. }
  14. ILogBackendCreator::TFactory::TRegistrator<TSysLogBackendCreator> TSysLogBackendCreator::Registrar("system");
  15. void TSysLogBackendCreator::DoToJson(NJson::TJsonValue& value) const {
  16. value["Ident"] = Ident;
  17. value["Facility"] = (int&)Facility;
  18. value["Flags"] = Flags;
  19. }