Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
icl_core::logging::LogStream Class Reference

Implements a thread-safe logging framework. More...

#include <LogStream.h>

Inheritance diagram for icl_core::logging::LogStream:
Inheritance graph
[legend]

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::ThreadStreamthreadStream (icl_core::logging::LogLevel log_level)
 
 ~LogStream ()
 

Private Types

typedef std::list< ThreadStreamInfoThreadStreamMap
 

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
 

Detailed Description

Implements a thread-safe logging framework.

Definition at line 54 of file LogStream.h.

Member Typedef Documentation

Definition at line 179 of file LogStream.h.

Constructor & Destructor Documentation

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.

Member Function Documentation

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.

icl_core::logging::LogLevel icl_core::logging::LogStream::initialLogLevel ( ) const
inline

Get the initial log level of this log stream.

Definition at line 75 of file LogStream.h.

bool icl_core::logging::LogStream::isActive ( ) const
inline

Checks if the log stream is active.

Definition at line 78 of file LogStream.h.

icl_core::String icl_core::logging::LogStream::name ( ) const
inline

Return the name of the log stream.

Definition at line 68 of file LogStream.h.

const char* icl_core::logging::LogStream::nameCStr ( ) const
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.

void icl_core::logging::LogStream::releaseThreadStream ( icl_core::logging::ThreadStream thread_stream)
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.

void icl_core::logging::LogStream::setActive ( bool  active = true)
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.

Friends And Related Function Documentation

friend class LoggingManager
friend

Definition at line 56 of file LogStream.h.

friend class ThreadStream
friend

Definition at line 57 of file LogStream.h.

Member Data Documentation

bool icl_core::logging::LogStream::m_active
private

Definition at line 183 of file LogStream.h.

ThreadId icl_core::logging::LogStream::m_empty_thread_id
staticprivate

Definition at line 189 of file LogStream.h.

icl_core::logging::LogLevel icl_core::logging::LogStream::m_initial_level
private

Definition at line 163 of file LogStream.h.

Semaphore icl_core::logging::LogStream::m_mutex
private

Definition at line 187 of file LogStream.h.

icl_core::String icl_core::logging::LogStream::m_name
private

Definition at line 182 of file LogStream.h.

std::set<LogOutputStream*> icl_core::logging::LogStream::m_output_stream_list
private

Definition at line 184 of file LogStream.h.

ThreadStreamMap icl_core::logging::LogStream::m_thread_stream_map
private

Definition at line 180 of file LogStream.h.


The documentation for this class was generated from the following files:


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:59