#pragma once #include #include #include #include #include #include "OwnSplitChannel.h" namespace DB { class TextLog; } namespace Poco::Util { class AbstractConfiguration; } class Loggers { public: void buildLoggers(Poco::Util::AbstractConfiguration & config, Poco::Logger & logger, const std::string & cmd_name = ""); void updateLevels(Poco::Util::AbstractConfiguration & config, Poco::Logger & logger); /// Close log files. On next log write files will be reopened. void closeLogs(Poco::Logger & logger); void setTextLog(std::shared_ptr log, int max_priority); private: Poco::AutoPtr log_file; Poco::AutoPtr error_log_file; Poco::AutoPtr syslog_channel; /// Previous value of logger element in config. It is used to reinitialize loggers whenever the value changed. std::string config_logger; std::weak_ptr text_log; int text_log_max_priority = -1; Poco::AutoPtr split; };