ezEngine  Milestone 7
ezLog Class Reference

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

#include <Log.h>

Static Public Member Functions

static void SetDefaultLogSystem (ezLogInterface *pInterface)
 Allows to change which logging system is used by default. If nothing is set, ezGlobalLog is used.
 
static ezLogInterfaceGetDefaultLogSystem ()
 Returns the currently set default logging system.
 
static void Error (const char *szFormat,...)
 An error that needs to be fixed as soon as possible.
 
static void Error (ezLogInterface *pInterface, const char *szFormat,...)
 Overload of Error() to output messages to a specific log.
 
static void SeriousWarning (const char *szFormat,...)
 Not an error, but definitely a big problem, that should be looked into very soon.
 
static void SeriousWarning (ezLogInterface *pInterface, const char *szFormat,...)
 Overload of SeriousWarning() to output messages to a specific log.
 
static void Warning (const char *szFormat,...)
 A potential problem or a performance warning. Might be possible to ignore it.
 
static void Warning (ezLogInterface *pInterface, const char *szFormat,...)
 Overload of Warning() to output messages to a specific log.
 
static void Success (const char *szFormat,...)
 Status information that something was completed successfully.
 
static void Success (ezLogInterface *pInterface, const char *szFormat,...)
 Overload of Success() to output messages to a specific log.
 
static void Info (const char *szFormat,...)
 Status information that is important.
 
static void Info (ezLogInterface *pInterface, const char *szFormat,...)
 Overload of Info() to output messages to a specific log.
 
static void Dev (const char *szFormat,...)
 Status information that is nice to have during development. More...
 
static void Dev (ezLogInterface *pInterface, const char *szFormat,...)
 Overload of Dev() to output messages to a specific log.
 
static void Debug (const char *szFormat,...)
 Status information during debugging. Very verbose. Usually only temporarily added to the code. More...
 
static void Debug (ezLogInterface *pInterface, const char *szFormat,...)
 Overload of Debug() to output messages to a specific log.
 
static void VerboseDebugMessage (const char *szFormat,...)
 This is a placeholder function for verbose logging during debugging some piece of code. More...
 
static void VerboseDebugMessage (ezLogInterface *pInterface, const char *szFormat,...)
 Overload of VerboseDebugMessage() to output messages to a specific log.
 

Static Private Member Functions

static void EndLogBlock (ezLogInterface *pInterface, ezLogBlock *pBlock)
 Ends grouping log messages.
 
static void BroadcastLoggingEvent (ezLogInterface *pInterface, ezLogMsgType::Enum type, const char *szString)
 
static void WriteBlockHeader (ezLogInterface *pInterface, ezLogBlock *pBlock)
 

Static Private Attributes

static ezThreadLocalPointer
< ezLogInterface
s_DefaultLogSystem
 The log system that messages are sent to when the user specifies no system himself.
 

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

static void ezLog::Debug ( const char *  szFormat,
  ... 
)
static

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

This function is compiled out in non-debug builds.

static void ezLog::Dev ( const char *  szFormat,
  ... 
)
static

Status information that is nice to have during development.

This function is compiled out in non-development builds.

static void ezLog::VerboseDebugMessage ( const char *  szFormat,
  ... 
)
inlinestatic

This is a placeholder function for verbose logging during debugging some piece of code.

By default this function does not do anything (it has an empty body). It is meant to be redirected to one of the other logging methods (e.g. Debug() ), using a #define. This allows to only enable it in selected cpp files. E.g. you can use it in hundreds of source files, but the function will only have an effect in those few files where a

#define VerboseDebugMessage Debug


is inserted, which will actually redirect all logging to another function. You can commit your code that calls this logging function, but it should always be 'deactivated', e.g. the line

#define VerboseDebugMessage Debug

should always be commented out.


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