ezEngine  Milestone 9
ezLog Class Reference

Static class that allows to write out logging information. More...

#include <Log.h>

Static Public Member Functions

static void SetThreadLocalLogSystem (ezLogInterface *pInterface)
 Allows to change which logging system is used by default on the current thread. If nothing is set, ezGlobalLog is used. More...
 
static ezLogInterfaceGetThreadLocalLogSystem ()
 Returns the currently set default logging system, or a thread local instance of ezGlobalLog, if nothing else was set.
 
static void SetDefaultLogLevel (ezLogMsgType::Enum LogLevel)
 Sets the default log level which is used when new per thread logging systems are created on demand. More...
 
static void Error (ezLogInterface *pInterface, const ezFormatString &string)
 An error that needs to be fixed as soon as possible.
 
template<typename... ARGS>
static void Error (const char *szFormat, ARGS &&... args)
 An error that needs to be fixed as soon as possible.
 
template<typename... ARGS>
static void Error (ezLogInterface *pInterface, const char *szFormat, ARGS &&... args)
 Overload of Error() to output messages to a specific log.
 
static void SeriousWarning (ezLogInterface *pInterface, const ezFormatString &string)
 Not an error, but definitely a big problem, that should be looked into very soon.
 
template<typename... ARGS>
static void SeriousWarning (const char *szFormat, ARGS &&... args)
 Not an error, but definitely a big problem, that should be looked into very soon.
 
template<typename... ARGS>
static void SeriousWarning (ezLogInterface *pInterface, const char *szFormat, ARGS &&... args)
 Overload of SeriousWarning() to output messages to a specific log.
 
static void Warning (ezLogInterface *pInterface, const ezFormatString &string)
 A potential problem or a performance warning. Might be possible to ignore it.
 
template<typename... ARGS>
static void Warning (const char *szFormat, ARGS &&... args)
 A potential problem or a performance warning. Might be possible to ignore it.
 
template<typename... ARGS>
static void Warning (ezLogInterface *pInterface, const char *szFormat, ARGS &&... args)
 Overload of Warning() to output messages to a specific log.
 
static void Success (ezLogInterface *pInterface, const ezFormatString &string)
 Status information that something was completed successfully.
 
template<typename... ARGS>
static void Success (const char *szFormat, ARGS &&... args)
 Status information that something was completed successfully.
 
template<typename... ARGS>
static void Success (ezLogInterface *pInterface, const char *szFormat, ARGS &&... args)
 Overload of Success() to output messages to a specific log.
 
static void Info (ezLogInterface *pInterface, const ezFormatString &string)
 Status information that is important.
 
template<typename... ARGS>
static void Info (const char *szFormat, ARGS &&... args)
 Status information that is important.
 
template<typename... ARGS>
static void Info (ezLogInterface *pInterface, const char *szFormat, ARGS &&... args)
 Overload of Info() to output messages to a specific log.
 
static void Dev (ezLogInterface *pInterface, const ezFormatString &string)
 Status information that is nice to have during development. More...
 
template<typename... ARGS>
static void Dev (const char *szFormat, ARGS &&... args)
 Status information that is nice to have during development. More...
 
template<typename... ARGS>
static void Dev (ezLogInterface *pInterface, const char *szFormat, ARGS &&... args)
 Overload of Dev() to output messages to a specific log.
 
static void Debug (ezLogInterface *pInterface, const ezFormatString &string)
 Status information during debugging. Very verbose. Usually only temporarily added to the code. More...
 
template<typename... ARGS>
static void Debug (const char *szFormat, ARGS &&... args)
 Status information during debugging. Very verbose. Usually only temporarily added to the code. More...
 
template<typename... ARGS>
static void Debug (ezLogInterface *pInterface, const char *szFormat, ARGS &&... args)
 Overload of Debug() to output messages to a specific log.
 
static void BroadcastLoggingEvent (ezLogInterface *pInterface, ezLogMsgType::Enum type, const char *szString)
 Usually called internally by the other log functions, but can be called directly, if the message type is already known. pInterface must be != nullptr.
 

Friends

class ezLogBlock
 

Detailed Description

Static class that allows to write out logging information.

This class takes logging information, prepares it and then broadcasts it to all interested code via the event interface. It does not write anything on disk or somewhere else, itself. Instead it allows to register custom log writers that can then write it to disk, to console, send it over a network or pop up a message box. Whatever suits the current situation. Since event handlers can be registered only temporarily, it is also possible to just gather all errors that occur during some operation and then unregister the event handler again.

Member Function Documentation

◆ Debug() [1/2]

static void ezLog::Debug ( ezLogInterface pInterface,
const ezFormatString string 
)
static

Status information during debugging. Very verbose. Usually only temporarily added to the code.

This function is compiled out in non-debug builds.

◆ Debug() [2/2]

template<typename... ARGS>
static void ezLog::Debug ( const char *  szFormat,
ARGS &&...  args 
)
inlinestatic

Status information during debugging. Very verbose. Usually only temporarily added to the code.

This function is compiled out in non-debug builds.

◆ Dev() [1/2]

static void ezLog::Dev ( ezLogInterface pInterface,
const ezFormatString string 
)
static

Status information that is nice to have during development.

This function is compiled out in non-development builds.

◆ Dev() [2/2]

template<typename... ARGS>
static void ezLog::Dev ( const char *  szFormat,
ARGS &&...  args 
)
inlinestatic

Status information that is nice to have during development.

This function is compiled out in non-development builds.

◆ SetDefaultLogLevel()

void ezLog::SetDefaultLogLevel ( ezLogMsgType::Enum  LogLevel)
static

Sets the default log level which is used when new per thread logging systems are created on demand.

Note that changes using this method will not affect already created log systems.

◆ SetThreadLocalLogSystem()

void ezLog::SetThreadLocalLogSystem ( ezLogInterface pInterface)
static

Allows to change which logging system is used by default on the current thread. If nothing is set, ezGlobalLog is used.

Replacing the log system on a thread does not delete the previous system, so it can be reinstated later again. This can be used to temporarily route all logging to a custom system.


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