Output_log_detail


Files

file  OutputLog.hpp
 The logging is implemented using two maps.

Functions

void stk::register_ostream (std::ostream &os, const std::string &name)
 Function register_ostream registers an output stream with the output stream registry.
void stk::unregister_ostream (std::ostream &os)
 Function unregister_ostream unregisters an output stream.
void stk::bind_output_streams (const std::string &output_description)
 Function bind_output_streams parses the output_description and opens and registers the log streams and binds the registered output streams to the registered log streams.
void stk::register_log_ostream (std::ostream &os, const std::string &name)
 Function register_log_ostream takes an existing std::ostream and makes it available for output redirection.
void stk::unregister_log_ostream (std::ostream &os)
 Function register_log_ostream takes an existing std::ostream and makes it available for output redirection.
void stk::create_log_file (const std::string &name, const std::string &path)
 Function create_log_file opens a log file at the specified path and adds it to the registry of log files with the specified name.
void stk::close_log_file (const std::string &name)
 Function close_log_file close the log file with the specified name and removes it from the registry of log files.
bool stk::is_registered_ostream (const std::string &name)
 Function is_registered_ostream returns true if an output stream of the specified name is registered.
const std::string & stk::get_log_path (const std::string &name)
 Function get_log_path returns the file path of the log file with the specified name from the log file registry.
std::ostream * stk::get_log_ostream (const std::string &name)
 Function get_log_file_ostream return the output stream of the log file with the specified name from the log registry.
std::ostream * stk::get_ostream_ostream (const std::string &name)
 Function get_ostream_streambuf locates the output stream registered with the specified name.
std::ostream * stk::get_ostream_tee_ostream (const std::string &name)
 Function get_ostream_tee_streambuf locates the tee streambuf registered with the specified name.


Function Documentation

void stk::register_ostream ( std::ostream &  os,
const std::string &  name 
)

Function register_ostream registers an output stream with the output stream registry.

The registration process creates an intermediate tee streambuf.

Parameters:
name a std::string const reference to the name of the output stream.
output_stream a std::ostream reference to the output stream to register.

Definition at line 258 of file OutputLog.cpp.

void stk::unregister_ostream ( std::ostream &  os  ) 

Function unregister_ostream unregisters an output stream.

Parameters:
output_stream a std::ostream reference to the output stream to unregister.

Definition at line 283 of file OutputLog.cpp.

void stk::bind_output_streams ( const std::string &  output_description  ) 

Function bind_output_streams parses the output_description and opens and registers the log streams and binds the registered output streams to the registered log streams.

The output description is defined as a white space separated string of command phrases. There are two types of command phrases, log file creation and output stream direction.

The log file creation phrase consists of a name, and equal sign (=) and a file path. The file path is opened and the log file stream is registered with the log streams.

The output stream phrase consists of a name, a greater than sign (>) and a output stream selector. The selector is a list of log streams or output streams which may be prefixed with a plus sign (+) or a minus sign (-). No prefix removes all current log and output streams from the named output stream before adding the new log or output stream. A plus prefix adds the new log or output stream to the named output stream and a minus prefix removes the log or output stream from the named output stream.

Parameters:
output_description a std::string const reference to the output desciption.

Definition at line 627 of file OutputLog.cpp.

void stk::register_log_ostream ( std::ostream &  os,
const std::string &  name 
)

Function register_log_ostream takes an existing std::ostream and makes it available for output redirection.

Parameters:
output_stream a std::ostream reference to the output stream to register.
name a std::string const reference to the name of this log stream.

Definition at line 191 of file OutputLog.cpp.

void stk::unregister_log_ostream ( std::ostream &  os  ) 

Function register_log_ostream takes an existing std::ostream and makes it available for output redirection.

Parameters:
output_stream a std::ostream reference to the output stream to register.

Definition at line 211 of file OutputLog.cpp.

void stk::create_log_file ( const std::string &  name,
const std::string &  path 
)

Function create_log_file opens a log file at the specified path and adds it to the registry of log files with the specified name.

This name is be used at to locate the path of the file or it's output stream from the registry using the get_log_file_path() and get_log_file_ostream() functions.

Parameters:
name a std::string const reference to the name to give the log file.
path a std::string const reference to the path of the log file to create.

Definition at line 161 of file OutputLog.cpp.

void stk::close_log_file ( const std::string &  name  ) 

Function close_log_file close the log file with the specified name and removes it from the registry of log files.

Parameters:
name a std::string const reference to the name of the log file to close.

Definition at line 176 of file OutputLog.cpp.

bool stk::is_registered_ostream ( const std::string &  name  ) 

Function is_registered_ostream returns true if an output stream of the specified name is registered.

Parameters:
name a std::string const reference to the output stream to test existence in the output stream registry.
Returns:
a bool value of true if the specified output stream is in the registry.

Definition at line 339 of file OutputLog.cpp.

const std::string & stk::get_log_path ( const std::string &  name  ) 

Function get_log_path returns the file path of the log file with the specified name from the log file registry.

If the specified name does not exist in the registry, an empty string is returned.

Parameters:
name a std::string const reference to the name of the log file to return its file path.
Returns:
a std::string const reference to the file path of the log file.

Definition at line 232 of file OutputLog.cpp.

std::ostream * stk::get_log_ostream ( const std::string &  name  ) 

Function get_log_file_ostream return the output stream of the log file with the specified name from the log registry.

If the specified name does not exist in the registry, a null pointer is returned.

Parameters:
name a std::string const reference to the name of the log file to return its output stream.
Returns:
a std::ostream pointer to the output stream of the log file.

Definition at line 246 of file OutputLog.cpp.

std::ostream * stk::get_ostream_ostream ( const std::string &  name  ) 

Function get_ostream_streambuf locates the output stream registered with the specified name.

If the specified output stream does not exist in the registry, a null pointer is returned.

Parameters:
name a std::string const reference of the name of the outputstream to return its tee streambuf.
Returns:
a std::ostream pointer to the output stream.

Definition at line 303 of file OutputLog.cpp.

std::ostream * stk::get_ostream_tee_ostream ( const std::string &  name  ) 

Function get_ostream_tee_streambuf locates the tee streambuf registered with the specified name.

If the specified output stream does not exist in the registry, a null pointer is returned.

Parameters:
name a std::string const reference of the name of the outputstream to return its tee streambuf.
Returns:
a tee_streambuf pointer to the tee streambuf.

Definition at line 327 of file OutputLog.cpp.


Generated on Tue Jul 13 09:27:33 2010 for Sierra Toolkit by  doxygen 1.4.7