Implements the actual logging for an individual thread. More...
#include <ThreadStream.h>
Implements the actual logging for an individual thread.
Definition at line 58 of file ThreadStream.h.
Type definition for flush() and endl() functions.
Definition at line 129 of file ThreadStream.h.
icl_core::logging::ThreadStream::ThreadStream | ( | LogStream * | parent | ) | [private] |
Thread stream objects are always created by LogStream so the constructor is private.
Definition at line 149 of file ThreadStream.cpp.
icl_core::logging::ThreadStream::~ThreadStream | ( | ) | [inline, private] |
Definition at line 220 of file ThreadStream.h.
void icl_core::logging::ThreadStream::changeLevel | ( | icl_core::logging::LogLevel | level | ) | [inline] |
Change the thread stream's log level to level.
Definition at line 64 of file ThreadStream.h.
Flushes the internal buffer of the thread stream to the parent's registered log output streams.
Definition at line 125 of file ThreadStream.cpp.
icl_core::logging::LogLevel icl_core::logging::ThreadStream::getLogLevel | ( | ) | const [inline] |
Return the current log level of this thread stream.
Definition at line 68 of file ThreadStream.h.
ThreadStream& icl_core::logging::ThreadStream::operator<< | ( | ThreadStreamFunc | func | ) | [inline] |
This operator allows us to stream the flush() and endl() functions into a ThreadStream just like any other datatype.
Definition at line 134 of file ThreadStream.h.
void icl_core::logging::ThreadStream::printf | ( | const char * | fmt, |
... | |||
) |
Writes text to the thread stream. Uses a printf-style format string and variable number of additional arguments.
Implicitly flushes the thread stream.
Definition at line 100 of file ThreadStream.cpp.
void icl_core::logging::ThreadStream::setClassname | ( | const char * | classname | ) |
Set the classname of the current log entry.
This value is automatically reset after a flush().
Definition at line 50 of file ThreadStream.cpp.
void icl_core::logging::ThreadStream::setFilename | ( | const char * | filename | ) |
Set the filename of the current log entry.
This value is automatically reset after a flush().
Definition at line 55 of file ThreadStream.cpp.
void icl_core::logging::ThreadStream::setFunction | ( | const char * | function | ) |
Set the function of the current log entry.
This value is automatically reset after a flush().
Definition at line 65 of file ThreadStream.cpp.
void icl_core::logging::ThreadStream::setLine | ( | size_t | line | ) |
Set the line of the current log entry.
This value is automatically reset after a flush().
Definition at line 70 of file ThreadStream.cpp.
void icl_core::logging::ThreadStream::setLineLogLevel | ( | icl_core::logging::LogLevel | line_log_level | ) |
Set the log level of the current log line.
Definition at line 75 of file ThreadStream.cpp.
void icl_core::logging::ThreadStream::setObjectname | ( | const char * | objectname | ) |
Set the objectname of the current log entry.
This value is automatically reset after a flush().
Definition at line 60 of file ThreadStream.cpp.
void icl_core::logging::ThreadStream::write | ( | const char * | buffer, |
size_t | number_of_bytes, | ||
size_t | protected_buffer_size = 1 |
||
) |
Writes number_of_bytes characters from buffer to the thread stream. protected_buffer_size is the number of bytes to keep free at the end of the buffer. Normal Write operations should leave this at 1 so that there is always room for a Newline character. Only the endl() function sets this to 0 to be able to add the Newline character and thus make sure that even when the buffer is filled completely, a line break is still inserted correctly.
Definition at line 80 of file ThreadStream.cpp.
friend class LogStream [friend] |
Definition at line 60 of file ThreadStream.h.
char icl_core::logging::ThreadStream::m_classname[cDEFAULT_LOG_SIZE+1] [private] |
Definition at line 229 of file ThreadStream.h.
char icl_core::logging::ThreadStream::m_data[cDEFAULT_LOG_SIZE+1] [private] |
Definition at line 232 of file ThreadStream.h.
char icl_core::logging::ThreadStream::m_filename[cDEFAULT_LOG_SIZE+1] [private] |
Definition at line 227 of file ThreadStream.h.
char icl_core::logging::ThreadStream::m_function[cDEFAULT_LOG_SIZE+1] [private] |
Definition at line 231 of file ThreadStream.h.
Definition at line 224 of file ThreadStream.h.
size_t icl_core::logging::ThreadStream::m_line [private] |
Definition at line 228 of file ThreadStream.h.
Definition at line 226 of file ThreadStream.h.
char icl_core::logging::ThreadStream::m_objectname[cDEFAULT_LOG_SIZE+1] [private] |
Definition at line 230 of file ThreadStream.h.
Definition at line 223 of file ThreadStream.h.
size_t icl_core::logging::ThreadStream::m_write_index [private] |
Definition at line 233 of file ThreadStream.h.