Logo Search packages:      
Sourcecode: nemiver version File versions

nemiver::common::LogStream Class Reference

#include <nmv-log-stream.h>

List of all members.

Detailed Description

the log stream class it features logs on cout, cerr, and files. it also features log domains and log levels.

Definition at line 53 of file nmv-log-stream.h.

Public Types

enum  StreamType {
  FILE_STREAM = 1, COUT_STREAM = 1 >> 1, CERR_STREAM = 1 >> 2, RFU0,
  RFU1, RFU2

Public Member Functions

void enable_domain (const string &a_domain, bool a_do_enable=true)
 enable or disable logging for a domain
bool is_domain_enabled (const string &a_domain)
 LogStream (enum LogLevel a_level=LOG_LEVEL_NORMAL, const string &a_default_domain=NMV_GENERAL_DOMAIN)
 default constructor of a log stream
LogStreamoperator<< (LogStream &(*a_manipulator)(LogStream &))
 log a stream manipulator
LogStreamoperator<< (char a_char)
 log a character
LogStreamoperator<< (double a_double)
 log a double
LogStreamoperator<< (int an_int)
 log an integer
LogStreamoperator<< (const UString &a_string)
 log zero teriminated strings
void pop_domain ()
 pops the last domain that has been pushed using LogStream::push_domain.
void push_domain (const string &a_domain)
LogStreamwrite (char a_msg, const string &a_domain=NMV_GENERAL_DOMAIN)
LogStreamwrite (double a_msg, const string &a_domain=NMV_GENERAL_DOMAIN)
LogStreamwrite (int a_msg, const string &a_domain=NMV_GENERAL_DOMAIN)
LogStreamwrite (const UString &a_msg, const string &a_domain=NMV_GENERAL_DOMAIN)
 log a message to the stream
LogStreamwrite (const char *a_buf, long a_buflen=-1, const string &a_domain=NMV_GENERAL_DOMAIN)
 writes a text string to the stream
virtual ~LogStream ()
 destructor of the log stream class

Static Public Member Functions

static void activate (bool a_activate)
 activate/de-activate the logging.
static LogStreamdefault_log_stream ()
 gets the log stream instanciated by the system by default. the options of this log stream are the global options set before the first call to this method.
static const char * get_stream_file_path ()
 gets the log file path, in case the stream type is set to FILE_STREAM
static enum StreamType get_stream_type ()
 gets the type of the instances of LogStream
static bool is_active ()
 tests wether the logging is activated or not.
static void set_log_domain_filter (const char *a_domain, long a_len=-1)
 sets a filter on the log domain only streams that have the same domain as the one set here will be logging data.
static void set_log_level_filter (enum LogLevel a_level)
 sets the log level filter. if the filter is set to LOG_LEVEL_NORMAL, only the log streams that have a log level set to LOG_LEVEL_NORMAL will actually log data. If the filter is set to LOG_LEVEL_VERBOSE, streams set to LOG_LEVEL_NORMAL *and* streams set to LOG_LEVEL_VERBOSE will be logging data.
static void set_stream_file_path (const char *a_file_path, long a_len=-1)
static void set_stream_type (enum StreamType a_type)
 set the type of all the log streams that will be instanciated (either cout, cerr, or log file). By default, the type of stream is set to COUT_STREAM. All the logs are sent to stdout.

Private Member Functions

 LogStream (LogStream const &)
LogStreamoperator= (LogStream const &)

Private Attributes

SafePtr< Priv > m_priv


LogStreamendl (LogStream &)
 log a '\n' and flushes the stream Use it like: nemiver::LogStream out ; out << "hello"<< nemiver::endl ;
LogStreamflush (LogStream &)
 flushes the stream Use it like: nemiver::LogStream out ; out << "Hello" << nemiver::flush ;
LogStreamlevel_normal (LogStream &a_stream)
 sets the log level to normal Use it like nemiver::LogStream out ; out << nemiver::level_normal << "blabla" ;
LogStreamlevel_verbose (LogStream &a_stream)
 sets the log level to verbose Use it lik: nemiver::LogStream out ; out << nemiver::level_verbose << "bla bla bla" ;
LogStreamtimestamp (LogStream &)
 logs a timestamp. Basically the the current date. You use it like: nemiver::LogStream out ; out << nemiver::timestamp ;


struct  Priv

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

Generated by  Doxygen 1.6.0   Back to index