|
MxEngine
|
#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 |
| LoggerImpl & | UseErrorStream (std::ostream *error) |
| LoggerImpl & | UseWarningStream (std::ostream *warning) |
| LoggerImpl & | UseDebugStream (std::ostream *debug) |
| LoggerImpl & | UseDebug (bool value=true) |
| LoggerImpl & | UseWarning (bool value=true) |
| LoggerImpl & | UseError (bool value=true) |
| LoggerImpl & | UseStackTrace (bool value=true) |
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
| 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
| invoker | name of module which invokes the debug message |
| message | debug message |
| 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)
| invoker | name of module which invokes the error |
| message | error message |
| 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
| LoggerImpl & MxEngine::LoggerImpl::UseDebug | ( | bool | value = true | ) |
enables / disables debug stream output
| LoggerImpl & MxEngine::LoggerImpl::UseDebugStream | ( | std::ostream * | debug | ) |
sets debug stream. nullptr as parameter disables debug output
| error | new stream pointer |
| LoggerImpl & MxEngine::LoggerImpl::UseError | ( | bool | value = true | ) |
enables / disables error stream output
| LoggerImpl & MxEngine::LoggerImpl::UseErrorStream | ( | std::ostream * | error | ) |
sets error stream. nullptr as parameter disables error output
| error | new stream pointer |
| LoggerImpl & MxEngine::LoggerImpl::UseStackTrace | ( | bool | value = true | ) |
enables / disables stacktrace output (see StackTrace() function)
| LoggerImpl & MxEngine::LoggerImpl::UseWarning | ( | bool | value = true | ) |
enables / disables warning stream output
| LoggerImpl & MxEngine::LoggerImpl::UseWarningStream | ( | std::ostream * | warning | ) |
sets warning stream. nullptr as parameter disables warning output
| error | new stream pointer |
| 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
| invoker | name of module which invokes the warning |
| message | warning message |
1.8.12