MxEngine
Public Member Functions | List of all members
MxEngine::LoggerImpl Class Reference

#include <Logger.h>

Public Member Functions

 LoggerImpl (const LoggerImpl &)=delete
 
 LoggerImpl (LoggerImpl &&)=delete
 
void Error (const MxString &invoker, const MxString &message) const
 
void Debug (const MxString &invoker, const MxString &message) const
 
void Warning (const MxString &invoker, const MxString &message) const
 
void StackTrace () const
 
LoggerImplUseErrorStream (std::ostream *error)
 
LoggerImplUseWarningStream (std::ostream *warning)
 
LoggerImplUseDebugStream (std::ostream *debug)
 
LoggerImplUseDebug (bool value=true)
 
LoggerImplUseWarning (bool value=true)
 
LoggerImplUseError (bool value=true)
 
LoggerImplUseStackTrace (bool value=true)
 

Detailed Description

Logger class is a singleton which is used by whole engine to output warnings, info, debug messages and errors it provides output stream forwarding and ignoring, colored output on some platforms and stacktrace for errors

Member Function Documentation

§ Debug()

void MxEngine::LoggerImpl::Debug ( const MxString &  invoker,
const MxString &  message 
) const

prints debug info to an debug stream (defaults to std::cout). Debug message is colored light-grey. Stacktrace is not printed

Parameters
invokername of module which invokes the debug message
messagedebug message

§ Error()

void MxEngine::LoggerImpl::Error ( const MxString &  invoker,
const MxString &  message 
) const

prints error to an error stream (defaults to std::cout). Error is colored red. By default stacktrace is also printed (may cause performance issues on some platforms)

Parameters
invokername of module which invokes the error
messageerror message

§ StackTrace()

void MxEngine::LoggerImpl::StackTrace ( ) const

prints stacktrace to error stream if stacktracing is enabled (defaults std::cout). Logger function itself, CRT functions or other system functions are ignored and not printed

§ UseDebug()

LoggerImpl & MxEngine::LoggerImpl::UseDebug ( bool  value = true)

enables / disables debug stream output

§ UseDebugStream()

LoggerImpl & MxEngine::LoggerImpl::UseDebugStream ( std::ostream *  debug)

sets debug stream. nullptr as parameter disables debug output

Parameters
errornew stream pointer

§ UseError()

LoggerImpl & MxEngine::LoggerImpl::UseError ( bool  value = true)

enables / disables error stream output

§ UseErrorStream()

LoggerImpl & MxEngine::LoggerImpl::UseErrorStream ( std::ostream *  error)

sets error stream. nullptr as parameter disables error output

Parameters
errornew stream pointer

§ UseStackTrace()

LoggerImpl & MxEngine::LoggerImpl::UseStackTrace ( bool  value = true)

enables / disables stacktrace output (see StackTrace() function)

§ UseWarning()

LoggerImpl & MxEngine::LoggerImpl::UseWarning ( bool  value = true)

enables / disables warning stream output

§ UseWarningStream()

LoggerImpl & MxEngine::LoggerImpl::UseWarningStream ( std::ostream *  warning)

sets warning stream. nullptr as parameter disables warning output

Parameters
errornew stream pointer

§ Warning()

void MxEngine::LoggerImpl::Warning ( const MxString &  invoker,
const MxString &  message 
) const

prints warning to an warning stream (defaults to std::cout). Warning is colored yellow. Stacktrace is not printed

Parameters
invokername of module which invokes the warning
messagewarning message

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