PLearn 0.1
Public Member Functions | Protected Attributes | Private Types
PLearn::LogInterceptorPStreamBuf Class Reference

This class sends stuff to a PL_LogPluginInterceptor when it's flushed. More...

Inheritance diagram for PLearn::LogInterceptorPStreamBuf:
Inheritance graph
[legend]
Collaboration diagram for PLearn::LogInterceptorPStreamBuf:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LogInterceptorPStreamBuf (PL_LogPluginInterceptor *log_plugin)
void outputParameters (const string &module_name, int requested_verbosity)
 Establish current-mode module-name and verbosity.
virtual void flush ()
 Flush actually invokes the Python function LogAppend if the string is not empty, and it empties it.

Protected Attributes

PL_LogPluginInterceptorm_log_plugin
string m_module_name
int m_requested_verbosity

Private Types

typedef StringPStreamBuf inherited

Detailed Description

This class sends stuff to a PL_LogPluginInterceptor when it's flushed.

Definition at line 95 of file pl_log.cc.


Member Typedef Documentation

Reimplemented from PLearn::StringPStreamBuf.

Definition at line 97 of file pl_log.cc.


Constructor & Destructor Documentation

PLearn::LogInterceptorPStreamBuf::LogInterceptorPStreamBuf ( PL_LogPluginInterceptor log_plugin) [inline]

Definition at line 100 of file pl_log.cc.

        : inherited(new string, "w", true /* DO own */),
          m_log_plugin(log_plugin),
          m_requested_verbosity(-1)
    { }

Member Function Documentation

void PLearn::LogInterceptorPStreamBuf::flush ( ) [virtual]

Flush actually invokes the Python function LogAppend if the string is not empty, and it empties it.

Reimplemented from PLearn::PStreamBuf.

Definition at line 126 of file pl_log.cc.

References PLearn::flush(), and PLASSERT.

{
    PLASSERT( st && m_log_plugin );
    inherited::flush();
    if (! st->empty()) {
        m_log_plugin->appendLog(m_module_name, *st);
        st->clear();
    }
}

Here is the call graph for this function:

void PLearn::LogInterceptorPStreamBuf::outputParameters ( const string &  module_name,
int  requested_verbosity 
)

Establish current-mode module-name and verbosity.

Definition at line 119 of file pl_log.cc.

{
    m_module_name = module_name;
    m_requested_verbosity = requested_verbosity;
}

Member Data Documentation

Definition at line 114 of file pl_log.cc.

Definition at line 115 of file pl_log.cc.

Definition at line 116 of file pl_log.cc.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines