// // log_manager.hpp // logging // // Created by Sam Jaffe on 4/1/19. // #pragma once #include #include namespace objects { namespace prototype { template class factory; }} namespace logging { class appender; class c_logger; class layout; class logger; class properties; /** * A singleton object that is designed for use constructing the various * loggers. At program start time, the programmer should provide the * configuration properties to the manager. Once the configuration has been * applied, you can then request loggers from the system. * TODO: Have manager automatically check certain locations for a config file */ class manager { private: std::unique_ptr pimpl_; public: static manager & instance(); /** * Functions to construct logger handles for use. When providing an unknown * logger name, the default logger_impl will be used instead (with the given * name wrapped around it). */ logger get(std::string const & name = ""); c_logger c_get(std::string const & name = ""); void configure(properties const & props); manager(); ~manager(); }; using appenders = objects::prototype::factory, properties const &>; using layouts = objects::prototype::factory, properties const &>; }