Clarisse 4.0 SP5b SDK  4.0.0.0.5.1
 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
 
CoreString get_class_interface () const
 
const unsigned long & get_class_info_id () const
 
bool is_kindof (const CoreClassInfo &cinfo) const
 
virtual const CoreClassInfoget_class_info () const
 
bool operator== (const CoreBaseObject &obj) 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
 
bool operator== (const CoreBaseType &obj) const
 

Protected Attributes

CoreLogCtxm_context
 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 ()
 
static bool ___class_destructor__ (void *instance, const bool &is_array)
 
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 
)
inline

Append a message to a log level

void CoreLogStreamer::flush ( int  level)
inline

Flush the given level (will call print_log on it)

unsigned int CoreLogStreamer::get_capacity ( void  ) const
inline

Get the current capacity

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

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.