Clarisse 5.0 SP8 SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Attributes | List of all members
CoreLogStreamer Class Reference
Inheritance diagram for CoreLogStreamer:
CoreBaseObject CoreBaseType

Public Member Functions

 CoreLogStreamer (CoreLogCtx &context)
void append (int level, const CoreString &msg)
void print_log (int level, const CoreString &str)
void flush (int level)
unsigned int get_capacity (void) const
void set_capacity (unsigned int capacity)
- Public Member Functions inherited from CoreBaseObject
bool is_kindof (const CoreBaseObject &object) const
virtual size_t get_memory_size () const
CoreString get_class_info_name () const
const unsigned long & get_class_info_id () const
virtual bool is_kindof (const CoreClassInfo &cinfo) const
virtual const CoreClassInfoget_class_info () const
template<class T >
T * cast ()
template<class T >
const T * cast () const
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const

Protected Attributes

 log context
CoreString m_messages [CoreLogLevel::LOG_LEVEL_COUNT]
 current messages
unsigned int m_capacity
 the max number of characters per log messages before they are actually logged

Additional Inherited Members

- Static Public Member Functions inherited from CoreBaseObject
static const CoreClassInfoclass_info ()
template<class T >
static T * cast (CoreBaseObject *object)
template<class T >
static const T * cast (const CoreBaseObject *object)

Detailed Description

This class stacks messages until a given capacity is reached, at which point it will dispatch the message to the CoreLogCtx instance.

Constructor & Destructor Documentation

CoreLogStreamer::CoreLogStreamer ( CoreLogCtx context)

Constructor. Will initialize the capacity to 80 because it's the default max column char count on Unix systems.

Member Function Documentation

void CoreLogStreamer::append ( int  level,
const CoreString message 

Append a message to a log level

void CoreLogStreamer::flush ( int  level)

Flush the given level (will call print_log on it)

unsigned int CoreLogStreamer::get_capacity ( void  ) const

Get the current capacity

void CoreLogStreamer::print_log ( int  level,
const CoreString message 

Print a log message at the given level. Will forward the log to the log context.

void CoreLogStreamer::set_capacity ( unsigned int  capacity)

Set the max capacity for all log levels. If a level overflow the new capacity, it will be flushed.