| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- //
- // log_manager.hpp
- // logging
- //
- // Created by Sam Jaffe on 4/1/19.
- //
- #pragma once
- #include <memory>
- #include <string>
- namespace objects { namespace prototype {
- template <typename, typename...> 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<struct manager_impl> 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<std::shared_ptr<appender>,
- properties const &>;
- using layouts =
- objects::prototype::factory<std::shared_ptr<layout>, properties const &>;
- }
|