karazeh
A cross-platform software updating library.
kzh::logger Class Reference

#include <logger.hpp>

+ Inheritance diagram for kzh::logger:

Public Member Functions

 logger (string_t context)
 
virtual ~logger ()
 
logstream alert () const
 
logstream crit () const
 
logstream debug () const
 
logstream error () const
 
logstream info () const
 
logstream notice () const
 
logstream plain () const
 
void set_uuid_prefix (string_t const &)
 
string_t const & uuid_prefix () const
 
logstream warn () const
 

Static Public Member Functions

static void deindent ()
 
static void enable_timestamps (bool on_or_off)
 
static void indent ()
 
static void mute ()
 
static void set_app_name (string_t const &app_name)
 
static void set_stream (std::ostream *)
 
static void set_threshold (char level)
 
static void unmute ()
 

Protected Member Functions

void rename_context (string_t const &)
 

Constructor & Destructor Documentation

kzh::logger::logger ( string_t  context)

Creates a new logger instance that can be used to spit out messages using a stream interface.

Loggers can either be manually instantiated or derived from.

The context identifies the module that this logger instance represents, ie: GameManager, db_adapter, UIEngine, etc.

kzh::logger::~logger ( )
virtual

Member Function Documentation

logstream kzh::logger::alert ( ) const

Message will be prefixed with [A]

logstream kzh::logger::crit ( ) const

Message will be prefixed with [C]

void kzh::logger::deindent ( )
static
void kzh::logger::enable_timestamps ( bool  on_or_off)
static

Messages will be prefixed with a timestamp of the following format: => dd-mm-yyyy hh:mm::ss

void kzh::logger::indent ( )
static
logstream kzh::logger::info ( ) const
void kzh::logger::mute ( )
static
logstream kzh::logger::notice ( ) const

Message will be prefixed with [N]

Referenced by kzh::downloader::fetch().

logstream kzh::logger::plain ( ) const
void kzh::logger::rename_context ( string_t const &  new_ctx)
protected
void kzh::logger::set_app_name ( string_t const &  app_name)
static

All messages will be prefixed by the specified application name

void kzh::logger::set_stream ( std::ostream *  s)
static

Override the stream to append the messages to (defaults to std::cout)

void kzh::logger::set_threshold ( char  level)
static

Assigns the threshold to use for filtering messages. Messages logged with a level "below" the assigned threshold will not be logged.

Available level thresholds (ordered): => D, I, N, W, E, A, C

void kzh::logger::set_uuid_prefix ( string_t const &  uuid)

Subsequent messages will be prefixed with {IN_UUID} positioned right after the [LEVEL] part.

void kzh::logger::unmute ( )
static
string_t const & kzh::logger::uuid_prefix ( ) const

The assigned UUID prefix, if any

logstream kzh::logger::warn ( ) const

Message will be prefixed with [W]

Referenced by kzh::downloader::fetch().


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