mod_servlet
C++Servlets
 All Classes Files Functions Variables Typedefs Macros Pages
logger.h File Reference

Contains definitions for the logging framework. More...

#include <experimental/string_view>
#include <atomic>
#include <string>
#include <memory>
#include <map>
#include <mutex>
#include <thread>
#include <iomanip>
#include <vector>
#include <servlet/lib/io_string.h>

Go to the source code of this file.

Classes

class  servlet::logging::log_output
 Abstract interface for logging output. More...
 
struct  servlet::logging::log_output_factory
 Abstract interface for log_output factory. More...
 
class  servlet::logging::prefix_printer
 Abstract interface for logging prefix printer. More...
 
struct  servlet::logging::prefix_printer_factory
 Abstract interface for prefix_printer factory. More...
 
class  servlet::logging::level_logger
 Logger with specific logging LEVEL to use. More...
 
class  servlet::logging::logger
 Logger class. More...
 
class  servlet::logging::log_registry
 Registry object to configure and hold available loggers. More...
 

Enumerations

enum  SYNC_POLICY { servlet::logging::SYNC_POLICY::SINGLE_THREAD, servlet::logging::SYNC_POLICY::SYNC, servlet::logging::SYNC_POLICY::ASYNC }
 Enumeration of supported synchronization policies.
 
enum  LEVEL {
  servlet::logging::LEVEL::CRITICAL, servlet::logging::LEVEL::ERROR, servlet::logging::LEVEL::WARNING, servlet::logging::LEVEL::INFO,
  servlet::logging::LEVEL::CONFIG, servlet::logging::LEVEL::DEBUG, servlet::logging::LEVEL::TRACE
}
 Enumeration of supported logging levels.
 

Functions

log_registry & servlet::logging::registry ()
 Returns global registry. More...
 
void servlet::logging::load_config (const char *cfg_file_name, const std::string &base_dir="")
 Loads configuration from file to global log_registry More...
 
std::shared_ptr< logger > servlet::logging::get_logger (const std::string &name)
 Returns logger with a given name from global log_registry More...
 
std::shared_ptr< logger > servlet::logging::get_logger ()
 Returns "root" logger from global log_registry More...
 
std::shared_ptr< logger > servlet::logging::get_class_logger (log_registry &registry, const char *class_name)
 Returns a logger from a given registry with the demangled name of the class. More...
 
std::shared_ptr< logger > servlet::logging::get_class_logger (const char *class_name)
 Returns class logger from the global log_registry More...
 

Variables

thread_local std::shared_ptr
< log_registry > 
servlet::logging::THREAD_REGISTRY
 Thread specific log_registry
 

Detailed Description

Contains definitions for the logging framework.