Logo Search packages:      
Sourcecode: nemiver version File versions

nemiver::common::LogStream::LogStream ( enum LogLevel  a_level = LOG_LEVEL_NORMAL,
const string &  a_default_domain = NMV_GENERAL_DOMAIN 
)

default constructor of a log stream

Parameters:
a_level the log level of the stream. This stream will log data if its log level is inferior or equal to the log level filter defined by LogStream::set_log_level_filter().
a_domain the log domain. A stream will log data if its its log level is <= to the log level filter, *and* if its domain equals the domain filter.

Definition at line 342 of file nmv-log-stream.cc.

References enable_domain(), get_stream_file_path(), and get_stream_type().

                                              :
    m_priv (new LogStream::Priv (a_domain))
{

    std::string file_path ;
    if (get_stream_type () == FILE_STREAM) {
        m_priv->sink = LogSinkSafePtr
            (new OfstreamLogSink (get_stream_file_path ())) ;
    } else if (get_stream_type () == COUT_STREAM) {
        m_priv->sink = LogSinkSafePtr (new CoutLogSink) ;
    } else if (get_stream_type () == CERR_STREAM) {
        m_priv->sink = LogSinkSafePtr (new CerrLogSink) ;
    } else {
        g_critical ("LogStream type not supported") ;
        throw Exception ("LogStream type not supported") ;
    }
    m_priv->stream_type = get_stream_type ();
    m_priv->level = a_level ;
    m_priv->load_enabled_domains_from_env () ;

    std::vector<UString>::const_iterator d ;
    for (d = m_priv->enabled_domains_from_env.begin ();
         d != m_priv->enabled_domains_from_env.end ();
         ++d) {
        enable_domain (*d) ;
    }
}


Generated by  Doxygen 1.6.0   Back to index