PLearn 0.1
|
This class sends stuff to a PL_LogPluginInterceptor when it's flushed. More...
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_LogPluginInterceptor * | m_log_plugin |
string | m_module_name |
int | m_requested_verbosity |
Private Types | |
typedef StringPStreamBuf | inherited |
This class sends stuff to a PL_LogPluginInterceptor when it's flushed.
typedef StringPStreamBuf PLearn::LogInterceptorPStreamBuf::inherited [private] |
Reimplemented from PLearn::StringPStreamBuf.
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) { }
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(); } }
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; }
string PLearn::LogInterceptorPStreamBuf::m_module_name [protected] |