Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
mbl_logger_root Class Reference

Singleton, keeps records of logging state. More...

#include <mbl_log.h>

List of all members.

Public Types

typedef vcl_map< vcl_string,
vcl_ostream * > 
stream_names_t

Public Member Functions

const mbl_log_categoriescategories ()
 List of category entries.
void load_log_config_file (const stream_names_t &stream_names=stream_names_t())
 Load a default configuration file.
void load_log_config (vcl_istream &config, const stream_names_t &stream_names=stream_names_t())
 Load a configuration from a stream.
void update_all_loggers ()
 Force all loggers to update themselves in light of changes to the root and configuration.

Private Member Functions

 mbl_logger_root ()

Private Attributes

mbl_log_categories categories_
mbl_log_null_streambuf null_streambuf_
vcl_ostream null_stream_
vcl_set< mbl_logger * > all_loggers_

Friends

class mbl_logger

Detailed Description

Singleton, keeps records of logging state.

Definition at line 303 of file mbl_log.h.


Member Typedef Documentation

typedef vcl_map<vcl_string, vcl_ostream *> mbl_logger_root::stream_names_t

Definition at line 322 of file mbl_log.h.


Constructor & Destructor Documentation

mbl_logger_root::mbl_logger_root ( ) [inline, private]

Definition at line 314 of file mbl_log.h.


Member Function Documentation

const mbl_log_categories& mbl_logger_root::categories ( ) [inline]

List of category entries.

Definition at line 320 of file mbl_log.h.

void mbl_logger_root::load_log_config ( vcl_istream &  is,
const stream_names_t stream_names = stream_names_t() 
)

Load a configuration from a stream.

Load a default configuration file.

Each section of the text should begin with a category. A logger named "A.B.C" will be controlled by a section labelled A.B.C The categories labels have a hierarchical structure, so if A.B.C doesn't exist, the code will look for a section labelled A.B, or A. If none of these exist it will use the "root" category. Each category has a level. If a log message has the same or higher priority than the given level, the message will be output. Finally the category destination must be specified as a "file_output" and the filename or "stream_output" and the stream name. The known stream names are "vcl_cout" and "vcl_cerr", and additional names can be provided through stream_names. The

   root: { level: INFO stream_output: test }
   obj3: { level: INFO stream_output: vcl_cout }\n
   obj3.obj6: { level: INFO file_output: results.txt }\n
   obj3.obj7.images: { level: INFO stream_output: vcl_cout dump_prefix: ./logging_dir/ }\n
  

where LEVEL is an integer - setting the logging level. see mbl_logger:levels for useful values.

Current Format is

  LEVEL
   

where LEVEL is an integer - setting the logging level. see mbl_logger:levels for useful values.

Definition at line 475 of file mbl_log.cxx.

void mbl_logger_root::load_log_config_file ( const stream_names_t stream_names = stream_names_t())

Load a default configuration file.

This function will look for a configuration file called "mbl_log.properties" in the current directory, or if no there, in the user's home directory. Unix users can call it ".mbl_log.properties" in their home directory. See load_log_config() for description of config file format, and stream_names.

Current Format is

  LEVEL
   

where LEVEL is an integer - setting the logging level. see mbl_logger:levels for useful values.

Definition at line 421 of file mbl_log.cxx.

void mbl_logger_root::update_all_loggers ( )

Force all loggers to update themselves in light of changes to the root and configuration.

This is already called automatically by load_log_config_file().

Definition at line 485 of file mbl_log.cxx.


Friends And Related Function Documentation

friend class mbl_logger [friend]

Definition at line 305 of file mbl_log.h.


Member Data Documentation

Definition at line 312 of file mbl_log.h.

Definition at line 306 of file mbl_log.h.

vcl_ostream mbl_logger_root::null_stream_ [private]

Definition at line 310 of file mbl_log.h.

Definition at line 309 of file mbl_log.h.


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