ModErn Text Analysis
META Enumerates Textual Applications
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
meta::logging::logger Class Reference

logger: Main logging class. More...

#include <logger.h>

Classes

class  log_line
 log_line: Represents a single message to be written to all sinks. More...
 
class  sink
 sink: A wrapper for a stream that a logger should write to. More...
 

Public Types

enum  severity_level {
  progress, trace, debug, info,
  warning, error, fatal
}
 severity_level: A demarcation of how severe a given message is. More...
 

Public Member Functions

void add_sink (const sink &s)
 Adds a sink to the given logger. More...
 
void add_sink (sink &&s)
 Adds a sink to the given logger. More...
 
void write_to_sinks (const log_line &line)
 Writes the given log_line to all sinks. More...
 

Static Public Member Functions

static std::string severity_string (severity_level sev)
 Determines the string form of a given severity_level. More...
 

Private Attributes

std::vector< sinksinks_
 The list of sinks to write to.
 

Detailed Description

logger: Main logging class.

Keeps track of a list of sinks to write lines to—these can be of any std::ostream-derived type.

Member Enumeration Documentation

severity_level: A demarcation of how severe a given message is.

Can be used to filter out messages below a certain threshold at the sink-specific level.

Member Function Documentation

static std::string meta::logging::logger::severity_string ( severity_level  sev)
inlinestatic

Determines the string form of a given severity_level.

Parameters
sevThe severity level to get a string for.
void meta::logging::logger::add_sink ( const sink s)
inline

Adds a sink to the given logger.

Parameters
sThe sink to add
void meta::logging::logger::add_sink ( sink &&  s)
inline

Adds a sink to the given logger.

Parameters
sThe sink to add
void meta::logging::logger::write_to_sinks ( const log_line line)
inline

Writes the given log_line to all sinks.

Parameters
lineThe log_line to write

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