mod_servlet
C++Servlets
 All Classes Files Functions Variables Typedefs Macros Pages
servlet::logging::prefix_printer Class Referenceabstract

Abstract interface for logging prefix printer. More...

#include <logger.h>

Public Member Functions

virtual void print_prefix (LEVEL level, const std::string &name, std::ostream &out) const =0
 Prints prefix to the log output. More...
 
virtual void load_config (std::map< std::string, std::string, std::less<>> &props, const std::string &conf_prefix)=0
 Loads configuration from the properties provided. More...
 

Detailed Description

Abstract interface for logging prefix printer.

The instance of prefix_printer object is responsible for the prefix printed on each line in the logging outptu (e.g. timestamp, thread id, log level, logger name, etc.)

Member Function Documentation

virtual void servlet::logging::prefix_printer::load_config ( std::map< std::string, std::string, std::less<>> &  props,
const std::string &  conf_prefix 
)
pure virtual

Loads configuration from the properties provided.

Only the properties with a given conf_prefix prefix are related to this object.

For example, if this object required property with name "time.format" and this method is called with conf_prefix of "simple." than the property with the name "simple.time.format" should be used to configure this object.

Parameters
propsProperties to use to configure this object,
conf_prefixPrefix for the propertiy keys
virtual void servlet::logging::prefix_printer::print_prefix ( LEVEL  level,
const std::string &  name,
std::ostream &  out 
) const
pure virtual

Prints prefix to the log output.

Parameters
levelLogging level used by logger for which the prefix is printed.
namename of logger for which is prefix printed.
outstd::ostream to print the prefix to.

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