Implements a thread-safe logging framework. More...
#include <LogStream.h>
Classes | |
struct | ThreadStreamInfo |
Public Member Functions | |
void | addOutputStream (LogOutputStream *new_stream) |
icl_core::logging::LogLevel | getLogLevel () const |
Get the log level of the current thread. More... | |
icl_core::logging::LogLevel | initialLogLevel () const |
Get the initial log level of this log stream. More... | |
bool | isActive () const |
Checks if the log stream is active. More... | |
LogStream (const icl_core::String &name, icl_core::logging::LogLevel initial_level=cDEFAULT_LOG_LEVEL) | |
icl_core::String | name () const |
Return the name of the log stream. More... | |
const char * | nameCStr () const |
void | printConfiguration () const |
Prints the list of connected log output streams. More... | |
void | removeOutputStream (LogOutputStream *stream) |
void | setActive (bool active=true) |
Activates or deactivates the log stream. More... | |
icl_core::logging::ThreadStream & | threadStream (icl_core::logging::LogLevel log_level) |
~LogStream () | |
Private Types | |
typedef std::list< ThreadStreamInfo > | ThreadStreamMap |
Private Member Functions | |
void | releaseThreadStream (icl_core::logging::ThreadStream *thread_stream) |
Private Member Functions inherited from icl_core::Noncopyable | |
Noncopyable () | |
virtual | ~Noncopyable () |
Private Attributes | |
bool | m_active |
icl_core::logging::LogLevel | m_initial_level |
Semaphore | m_mutex |
icl_core::String | m_name |
std::set< LogOutputStream * > | m_output_stream_list |
ThreadStreamMap | m_thread_stream_map |
Static Private Attributes | |
static ThreadId | m_empty_thread_id |
Friends | |
class | LoggingManager |
class | ThreadStream |
Implements a thread-safe logging framework.
Definition at line 54 of file LogStream.h.
|
private |
Definition at line 179 of file LogStream.h.
icl_core::logging::LogStream::LogStream | ( | const icl_core::String & | name, |
icl_core::logging::LogLevel | initial_level = cDEFAULT_LOG_LEVEL |
||
) |
Creates a new logstream which is not yet connected to any log output stream.
Definition at line 39 of file LogStream.cpp.
icl_core::logging::LogStream::~LogStream | ( | ) |
Definition at line 54 of file LogStream.cpp.
void icl_core::logging::LogStream::addOutputStream | ( | LogOutputStream * | new_stream | ) |
Adds a new log output stream to the log stream. All log messages are additionally written to this new log output stream.
Definition at line 72 of file LogStream.cpp.
icl_core::logging::LogLevel icl_core::logging::LogStream::getLogLevel | ( | ) | const |
Get the log level of the current thread.
Definition at line 66 of file LogStream.cpp.
|
inline |
Get the initial log level of this log stream.
Definition at line 75 of file LogStream.h.
|
inline |
Checks if the log stream is active.
Definition at line 78 of file LogStream.h.
|
inline |
Return the name of the log stream.
Definition at line 68 of file LogStream.h.
|
inline |
Definition at line 69 of file LogStream.h.
void icl_core::logging::LogStream::printConfiguration | ( | ) | const |
Prints the list of connected log output streams.
Definition at line 156 of file LogStream.cpp.
|
private |
Definition at line 252 of file LogStream.cpp.
void icl_core::logging::LogStream::removeOutputStream | ( | LogOutputStream * | stream | ) |
Removes a log output stream from the log stream. Log messages are no longer written to this log output stream.
Definition at line 81 of file LogStream.cpp.
|
inline |
Activates or deactivates the log stream.
Definition at line 72 of file LogStream.h.
icl_core::logging::ThreadStream & icl_core::logging::LogStream::threadStream | ( | icl_core::logging::LogLevel | log_level | ) |
Returns the underlying thread stream for the current thread.
This function should usually not be used directly. It is mainly intended to be used indirectly via the LOGGING_* log macros.
Definition at line 90 of file LogStream.cpp.
|
friend |
Definition at line 56 of file LogStream.h.
|
friend |
Definition at line 57 of file LogStream.h.
|
private |
Definition at line 183 of file LogStream.h.
|
staticprivate |
Definition at line 189 of file LogStream.h.
|
private |
Definition at line 163 of file LogStream.h.
|
private |
Definition at line 187 of file LogStream.h.
|
private |
Definition at line 182 of file LogStream.h.
|
private |
Definition at line 184 of file LogStream.h.
|
private |
Definition at line 180 of file LogStream.h.