vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
vrecko::Logger Class Reference

#include <Logger.h>

Classes

struct  OutputNotificationFuncStored
 
class  OutstandingCounter
 
class  OutstandingText
 
struct  TimingInfo
 

Public Types

typedef void(* OutputNotificationFuncType )(unsigned long dwOutputType, const char *outputLine, void *userParam)
 

Public Member Functions

 Logger ()
 
 ~Logger ()
 
bool init ()
 
void done ()
 
void update ()
 
void noticeLog (const char *notice="",...)
 
void vnoticeLog (const char *notice, va_list args)
 
void warningLog (const char *warning="",...)
 
void vwarningLog (const char *warning, va_list args)
 
void errorLog (const char *error="",...)
 
void verrorLog (const char *error, va_list args)
 
void debugLog (const char *debugText="",...)
 
void vdebugLog (const char *debugText, va_list args)
 
void debugFileLog (const char *debugText="",...)
 
void vdebugFileLog (const char *debugText, va_list args)
 
void debugFlush (const char *debugText="",...)
 
void vdebugFlush (const char *debugText, va_list args)
 
unsigned long getAllowedOutput ()
 
void setAllowedOutput (unsigned long dwNewOutput)
 
unsigned long getOutputDest ()
 
void setOutputDest (unsigned long dwNewOutputDest)
 
void startTiming (std::string sectionName)
 
void stopTiming (std::string sectionName, DWORD dwOutputType=LOGGER_OUTPUTTYPE_DEBUG)
 
void writeBMCounter (const char *pName, float fValue)
 
osg::Timer_t tick ()
 
bool registerOutputNotification (OutputNotificationFuncType aFunc, void *userParam)
 
bool unregisterOutputNotification (OutputNotificationFuncType aFunc)
 

Protected Member Functions

void addOutstandingText (unsigned long dwOutputType, const char *buffer)
 
void processOutstandingTexts ()
 
void writeBMCounterLowLevel (unsigned int time, const char *pName, float fValue)
 
void processOutstandingCounters ()
 
void processTextMain (unsigned long dwOutputType, const char *buffer)
 
bool openBenchmarkFile ()
 
void textLog (unsigned long dwOutputType, const char *text="",...)
 
void vtextLog (unsigned long dwOutputType, const char *text, va_list args)
 

Protected Attributes

std::ofstream log_file
 
osg::Timer_t starttime_stamp
 
DWORD dwMainThreadId
 
MTLock generalLock
 
BenchmarkWriter bm
 
DynamicArray< OutstandingTextoutstandingTexts
 
DynamicArray< OutstandingCounteroutstandingCounters [2]
 
int countersActiveIndex
 
MTLock countersActiveLock
 
std::map< std::string,
TimingInfo, std::less
< std::string > > 
sectionsTiming
 
DynamicArray
< OutputNotificationFuncStored
outFuncs
 
logger_streambufnew_cout
 
logger_streambufnew_cerr
 
std::streambuf * old_cout_buf
 
std::streambuf * old_cerr_buf
 
std::ostream * old_cout
 
unsigned long dwAllowedOutput
 
unsigned long dwOutputDest
 
HANDLE hOriginalStdHandle
 
WORD wOriginalConsoleAttributes
 

Friends

class World
 

Member Typedef Documentation

typedef void(* vrecko::Logger::OutputNotificationFuncType)(unsigned long dwOutputType, const char *outputLine, void *userParam)

Constructor & Destructor Documentation

vrecko::Logger::Logger ( )
vrecko::Logger::~Logger ( )

Member Function Documentation

void vrecko::Logger::addOutstandingText ( unsigned long  dwOutputType,
const char *  buffer 
)
protected
void vrecko::Logger::debugFileLog ( const char *  debugText = "",
  ... 
)
void vrecko::Logger::debugFlush ( const char *  debugText = "",
  ... 
)
void vrecko::Logger::debugLog ( const char *  debugText = "",
  ... 
)
void vrecko::Logger::done ( )
void vrecko::Logger::errorLog ( const char *  error = "",
  ... 
)
unsigned long vrecko::Logger::getAllowedOutput ( )
inline
unsigned long vrecko::Logger::getOutputDest ( )
inline
bool vrecko::Logger::init ( )
void vrecko::Logger::noticeLog ( const char *  notice = "",
  ... 
)
bool vrecko::Logger::openBenchmarkFile ( )
protected
void vrecko::Logger::processOutstandingCounters ( )
protected
void vrecko::Logger::processOutstandingTexts ( )
protected
void vrecko::Logger::processTextMain ( unsigned long  dwOutputType,
const char *  buffer 
)
protected
bool vrecko::Logger::registerOutputNotification ( OutputNotificationFuncType  aFunc,
void *  userParam 
)
void vrecko::Logger::setAllowedOutput ( unsigned long  dwNewOutput)
inline
void vrecko::Logger::setOutputDest ( unsigned long  dwNewOutputDest)
inline
void vrecko::Logger::startTiming ( std::string  sectionName)
void vrecko::Logger::stopTiming ( std::string  sectionName,
DWORD  dwOutputType = LOGGER_OUTPUTTYPE_DEBUG 
)
void vrecko::Logger::textLog ( unsigned long  dwOutputType,
const char *  text = "",
  ... 
)
protected
osg::Timer_t vrecko::Logger::tick ( )
inline
bool vrecko::Logger::unregisterOutputNotification ( OutputNotificationFuncType  aFunc)
void vrecko::Logger::update ( void  )
void vrecko::Logger::vdebugFileLog ( const char *  debugText,
va_list  args 
)
void vrecko::Logger::vdebugFlush ( const char *  debugText,
va_list  args 
)
void vrecko::Logger::vdebugLog ( const char *  debugText,
va_list  args 
)
void vrecko::Logger::verrorLog ( const char *  error,
va_list  args 
)
void vrecko::Logger::vnoticeLog ( const char *  notice,
va_list  args 
)
void vrecko::Logger::vtextLog ( unsigned long  dwOutputType,
const char *  text,
va_list  args 
)
protected
void vrecko::Logger::vwarningLog ( const char *  warning,
va_list  args 
)
void vrecko::Logger::warningLog ( const char *  warning = "",
  ... 
)
void vrecko::Logger::writeBMCounter ( const char *  pName,
float  fValue 
)
void vrecko::Logger::writeBMCounterLowLevel ( unsigned int  time,
const char *  pName,
float  fValue 
)
protected

Friends And Related Function Documentation

friend class World
friend

Member Data Documentation

BenchmarkWriter vrecko::Logger::bm
protected
int vrecko::Logger::countersActiveIndex
protected
MTLock vrecko::Logger::countersActiveLock
protected
unsigned long vrecko::Logger::dwAllowedOutput
protected
DWORD vrecko::Logger::dwMainThreadId
protected
unsigned long vrecko::Logger::dwOutputDest
protected
MTLock vrecko::Logger::generalLock
protected
HANDLE vrecko::Logger::hOriginalStdHandle
protected
std::ofstream vrecko::Logger::log_file
protected
logger_streambuf * vrecko::Logger::new_cerr
protected
logger_streambuf* vrecko::Logger::new_cout
protected
std::streambuf * vrecko::Logger::old_cerr_buf
protected
std::ostream* vrecko::Logger::old_cout
protected
std::streambuf* vrecko::Logger::old_cout_buf
protected
DynamicArray<OutputNotificationFuncStored> vrecko::Logger::outFuncs
protected
DynamicArray<OutstandingCounter> vrecko::Logger::outstandingCounters[2]
protected
DynamicArray<OutstandingText> vrecko::Logger::outstandingTexts
protected
std::map<std::string, TimingInfo, std::less<std::string> > vrecko::Logger::sectionsTiming
protected
osg::Timer_t vrecko::Logger::starttime_stamp
protected
WORD vrecko::Logger::wOriginalConsoleAttributes
protected

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