snaplogger: snaplogger::private_logger Class Reference

snaplogger  1.0.0
Easy to use logger in C++.
Inheritance diagram for snaplogger::private_logger:
Collaboration diagram for snaplogger::private_logger:
Public Types typedef std::shared_ptr< private_loggerpointer_t   typedef std::weak_ptr< loggerweak_pointer_t   Public Member Functions void add_appender (appender::pointer_t a)   void add_component_to_ignore (component::pointer_t comp)   void add_component_to_include (component::pointer_t comp)   void add_config (std::string const &config_filename)   appender::pointer_t add_console_appender ()   appender::pointer_t add_file_appender (std::string const &filename)   void add_severity (severity::pointer_t sev)  Add a severity. More...
  appender::pointer_t add_syslog_appender (std::string const &identity)   appender::pointer_t create_appender (std::string const &type, std::string const &name)   environment::pointer_t create_environment ()   void create_thread ()   void delete_thread ()   component::pointer_t get_component (std::string const &name)   format::pointer_t get_default_format ()   function::pointer_t get_function (std::string const &name) const   severity_t get_lowest_severity () const   map_diagnostics_t get_map_diagnostics ()   string_vector_t get_nested_diagnostics () const   severity::pointer_t get_severity (std::string const &name) const   severity::pointer_t get_severity (severity_t sev) const   variable::pointer_t get_variable (std::string const &type)   bool has_appender (std::string const &type) const   bool has_functions () const   bool has_severities () const   bool has_thread () const   bool is_asynchronous () const   bool is_configured () const   void log_message (message const &msg)   void pop_nested_diagnostic ()   void process_message (message const &msg)   void push_nested_diagnostic (std::string const &diagnostic)   void reduce_severity (severity_t severity_level)   void register_appender_factory (appender_factory::pointer_t factory)   void register_function (function::pointer_t func)   void register_variable_factory (variable_factory::pointer_t factory)   void reopen ()   void reset ()  Reset the logger to its startup state. More...
  void send_message_to_thread (message::pointer_t msg)   void set_asynchronous (bool status)   void set_config (advgetopt::getopt const &params)   void set_diagnostic (std::string const &key, std::string const &diagnostic)   void set_severity (severity_t severity_level)   void severity_changed (severity_t severity_level)   virtual void shutdown () override   void unset_diagnostic (std::string const &key)   Static Public Member Functions static logger::pointer_t get_instance ()   Protected Attributes component::pointer_t f_normal_component = component::pointer_t()   Private Member Functions  private_logger (private_logger const &rhs)=delete   private_loggeroperator= (private_logger const &rhs)=delete   Private Attributes appender_factory_t f_appender_factories = appender_factory_t()   asynchronous_logger_pointer_t f_asynchronous_logger = asynchronous_logger_pointer_t()   component_map_t f_components = component_map_t()   format::pointer_t f_default_format = format::pointer_t()   environment_map_t f_environment = environment_map_t()   message_fifo_t::pointer_t f_fifo = message_fifo_t::pointer_t()   function_map_t f_functions = function_map_t()   map_diagnostics_t f_map_diagnostics = map_diagnostics_t()   string_vector_t f_nested_diagnostics = string_vector_t()   severity_by_name_t f_severity_by_name = severity_by_name_t()   severity_by_severity_t f_severity_by_severity = severity_by_severity_t()   cppthread::thread::pointer_t f_thread = cppthread::thread::pointer_t()   variable_factory_map_t f_variable_factories = variable_factory_map_t()   Detailed Description

Definition at line 86 of file private_logger.h.

Member Function Documentation
void snaplogger::private_logger::add_severity ( severity::pointer_t  sev)

This function adds a severity to the private logger object.

Remember that a severity can be given aliases so this function may add quite a few entries, not just one.

Warning
You should not be calling this function directly. Please see the direct snaplogger::add_severity() function instead.
Exceptions
duplicate_errorThe function verifies that the new severity is not a duplicate of an existing system severity.
Parameters
[in]sevThe severity object to be added.

Definition at line 240 of file private_logger.cpp.

void snaplogger::logger::reset ( ) inherited

This function resets the logger to non-asynchronous and no appenders.

This is mainly used in our unit tests so we do not have to run the tests one at a time. It should nearly never be useful in your environment except if you do a fork() and wanted the child to have its own special log environment.

Definition at line 131 of file logger.cpp.


The documentation for this class was generated from the following files:

This document is part of the Snap! Websites Project.

Copyright by Made to Order Software Corp.

Syndicate content

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly