#include <Logger.h>
Public Types | |
typedef _CharT | char_type |
typedef _Traits | traits_type |
typedef std::basic_ostream < char_type, traits_type > | ostream_type |
typedef std::basic_streambuf < char_type, traits_type > | streambuf_type |
typedef coil::Mutex | Mutex |
typedef coil::Guard< Mutex > | Guard |
Public Member Functions | |
log_stream (streambuf_type *sb, int levelmin, int levelmax, int level) | |
Constructor. | |
virtual void | header (int level) |
Message header appender function. | |
bool | setLevel (int level) |
Set the log level. | |
int | getLevel () const |
Get the log level. | |
void | enableLock () |
Enable the lock mode. | |
void | disableLock () |
Disable the lock mode. | |
ostream_type & | level (int level) |
Acquire log stream. | |
bool | isValid (int level) const |
void | lock () |
Acquire log lock Acquire log lock when the lock mode is set. | |
void | unlock () |
Release the log lock Release the log lock when the lock mode is set. | |
Static Public Attributes | |
static bool | m_lockEnable = true |
static Mutex | m_mutex |
Protected Member Functions | |
~log_stream () | |
log_stream () | |
log_stream (const log_stream &x) | |
log_stream & | operator= (const log_stream &x) |
typedef _CharT coil::log_stream< _CharT, _Traits >::char_type |
typedef _Traits coil::log_stream< _CharT, _Traits >::traits_type |
typedef std::basic_ostream<char_type, traits_type> coil::log_stream< _CharT, _Traits >::ostream_type |
typedef std::basic_streambuf<char_type, traits_type> coil::log_stream< _CharT, _Traits >::streambuf_type |
typedef coil::Mutex coil::log_stream< _CharT, _Traits >::Mutex |
typedef coil::Guard<Mutex> coil::log_stream< _CharT, _Traits >::Guard |
coil::log_stream< _CharT, _Traits >::log_stream | ( | streambuf_type * | sb, | |
int | levelmin, | |||
int | levelmax, | |||
int | level | |||
) | [inline] |
Constructor.
Constructor
streambuf | basic_streambuf type object | |
levelmin | minimum value for log level | |
levelmax | maximum value for log level | |
level | default log level |
coil::log_stream< _CharT, _Traits >::~log_stream | ( | ) | [inline, protected] |
coil::log_stream< _CharT, _Traits >::log_stream | ( | ) | [protected] |
coil::log_stream< _CharT, _Traits >::log_stream | ( | const log_stream< _CharT, _Traits > & | x | ) | [protected] |
virtual void coil::log_stream< _CharT, _Traits >::header | ( | int | level | ) | [inline, virtual] |
Message header appender function.
Subclasses of this class should override this operation, and this function should be defined to append some header to the log messages.
Reimplemented in RTC::Logger.
Referenced by coil::log_stream< char >::level().
bool coil::log_stream< _CharT, _Traits >::setLevel | ( | int | level | ) | [inline] |
Set the log level.
Set the log level.
level | Log level |
int coil::log_stream< _CharT, _Traits >::getLevel | ( | ) | const [inline] |
Get the log level.
Get the log level.
void coil::log_stream< _CharT, _Traits >::enableLock | ( | ) | [inline] |
Enable the lock mode.
Enable the lock mode.
void coil::log_stream< _CharT, _Traits >::disableLock | ( | ) | [inline] |
Disable the lock mode.
Disable the lock mode.
ostream_type& coil::log_stream< _CharT, _Traits >::level | ( | int | level | ) | [inline] |
Acquire log stream.
Investigate the specified log level and get its log stream. If the specified log level is under the set log level, this class will be returned. If the specified log level exceeds the set log level, a dummy log class will be returned.
level | The specified log level |
bool coil::log_stream< _CharT, _Traits >::isValid | ( | int | level | ) | const [inline] |
void coil::log_stream< _CharT, _Traits >::lock | ( | ) | [inline] |
Acquire log lock Acquire log lock when the lock mode is set.
void coil::log_stream< _CharT, _Traits >::unlock | ( | ) | [inline] |
Release the log lock Release the log lock when the lock mode is set.
log_stream& coil::log_stream< _CharT, _Traits >::operator= | ( | const log_stream< _CharT, _Traits > & | x | ) | [protected] |
bool coil::log_stream< _CharT, _Traits >::m_lockEnable = true [inline, static] |
coil::Mutex coil::log_stream< _CharT, _Traits >::m_mutex [inline, static] |
Referenced by coil::log_stream< char >::lock(), and coil::log_stream< char >::unlock().