Open 3D Engine EMotionFX Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
MCore::LogCallback Class Referenceabstract

#include <LogManager.h>

Inherited by EMStudio::LogWindowCallback, and MCore::AzLogCallback.

Public Types

enum  ELogLevel {
  LOGLEVEL_NONE = 0 , LOGLEVEL_FATAL = 1 << 0 , LOGLEVEL_ERROR = 1 << 1 , LOGLEVEL_WARNING = 1 << 2 ,
  LOGLEVEL_INFO = 1 << 3 , LOGLEVEL_DETAILEDINFO = 1 << 4 , LOGLEVEL_DEBUG = 1 << 5 , LOGLEVEL_ALL = (LOGLEVEL_FATAL | LOGLEVEL_ERROR | LOGLEVEL_WARNING | LOGLEVEL_INFO | LOGLEVEL_DETAILEDINFO | LOGLEVEL_DEBUG) ,
  LOGLEVEL_DEFAULT = (LOGLEVEL_FATAL | LOGLEVEL_ERROR | LOGLEVEL_WARNING | LOGLEVEL_INFO | LOGLEVEL_DETAILEDINFO)
}
 

Public Member Functions

 LogCallback ()
 
virtual ~LogCallback ()
 
virtual void Log (const char *text, ELogLevel logLevel)=0
 
virtual uint32 GetType () const =0
 
MCORE_INLINE ELogLevel GetLogLevels () const
 
void SetLogLevels (ELogLevel logLevels)
 

Protected Attributes

ELogLevel m_logLevels
 

Detailed Description

The log callback interface. Classes inherited from the callback interface can be added to the log manager's stack through which it iterates each time you log something. The Log() method of the callback is called when logging. It can for example be used to write into a combo box in a MFC environment or into an in-game console.

Member Enumeration Documentation

◆ ELogLevel

The importance of a logged message.

Enumerator
LOGLEVEL_NONE 

Use this log level to disable all logging for the callback.

LOGLEVEL_FATAL 

Use this for errors that are very likely to crash the application.

LOGLEVEL_ERROR 

Use this for errors that might result into something unexpected.

LOGLEVEL_WARNING 

Use this for errors that won't hurt the stability, but might result in something visually incorrect for example.

LOGLEVEL_INFO 

Use this for grouped, general information, e.g. when loading nodes only show how many nodes have been loaded without any additional information.

LOGLEVEL_DETAILEDINFO 

Use this for detailed information, e.g. when loading nodes you can log the name, parent and all information stored inside the structure.

LOGLEVEL_DEBUG 

Use this for debugging information, e.g. log vertex values which is very slow and not desired in a release built.

LOGLEVEL_ALL 

Use this for enabling all kinds of log levels.

LOGLEVEL_DEFAULT 

Default log level. Displays everything except of debug logging.

Constructor & Destructor Documentation

◆ LogCallback()

MCore::LogCallback::LogCallback ( )

Default constructor.

◆ ~LogCallback()

virtual MCore::LogCallback::~LogCallback ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ GetLogLevels()

MCORE_INLINE ELogLevel MCore::LogCallback::GetLogLevels ( ) const
inline

Get the log levels this callback will accept and pass through. To check if a log level is enabled use logical bitwise and comparison, example: if (GetLogLevels() & LOGLEVEL_EXAMPLE).

Returns
The log levels packed as bit flags which are enabled on the callback.

◆ GetType()

virtual uint32 MCore::LogCallback::GetType ( ) const
pure virtual

Get the unique log callback type ID.

Returns
The log callback type identification number.

Implemented in EMStudio::LogWindowCallback, and MCore::AzLogCallback.

◆ Log()

virtual void MCore::LogCallback::Log ( const char *  text,
ELogLevel  logLevel 
)
pure virtual

The abstract callback logging method.

Parameters
textThe text to log.
logLevelThe log message priority.

Implemented in EMStudio::LogWindowCallback, and MCore::AzLogCallback.

◆ SetLogLevels()

void MCore::LogCallback::SetLogLevels ( ELogLevel  logLevels)

Set the log levels this callback will accept and pass through. To enable multiple log levels use the logical bitwise or operation, example: (LOGLEVEL_WARNING | LOGLEVEL_INFO). The LogManager will automatically informed about the log level flags change by calling the LogManager::InitLogLevels() function.

Parameters
logLevelsThe log levels packed as bit flags which are enabled on the callback.

Member Data Documentation

◆ m_logLevels

ELogLevel MCore::LogCallback::m_logLevels
protected

The log levels that will pass the callback. All messages from log flags which are disabled won't be logged. The default value of the log level will be LOGLEVEL_DEFAULT.


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