Open 3D Engine AzCore 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.
AZ::ILogger Class Referenceabstract

This is an AZ::Interface<> for logging. Usage: #include <AzCore/Console/ILogger.h> AZLOG_INFO("Your message here"); AZLOG_WARN("Your warn message here");. More...

#include <ILogger.h>

Public Types

using LogEvent = AZ::Event< LogLevel, const char *, const char *, const char *, int32_t >
 

Public Member Functions

 AZ_RTTI (ILogger, "{69950316-3626-4C9D-9DCA-2E7ABF84C0A9}")
 
virtual void SetLogName (const char *logName)=0
 
virtual const char * GetLogName () const =0
 
virtual void SetLogLevel (LogLevel logLevel)=0
 
virtual LogLevel GetLogLevel () const =0
 
virtual void BindLogHandler (LogEvent::Handler &hander)=0
 
virtual bool IsTagEnabled (AZ::HashValue32 hashValue)=0
 
virtual void Flush ()=0
 
void va_start (args, line)
 
 va_end (args)
 

Detailed Description

This is an AZ::Interface<> for logging. Usage: #include <AzCore/Console/ILogger.h> AZLOG_INFO("Your message here"); AZLOG_WARN("Your warn message here");.

Member Function Documentation

◆ BindLogHandler()

virtual void AZ::ILogger::BindLogHandler ( LogEvent::Handler hander)
pure virtual

Binds a log event handler.

Parameters
handlerthe handler to bind to logging events

◆ Flush()

virtual void AZ::ILogger::Flush ( )
pure virtual

Immediately Flushes any pending messages without waiting for next thread update. Should be invoked whenever unloading any shared library or module to avoid crashing on dangling string pointers

◆ GetLogLevel()

virtual LogLevel AZ::ILogger::GetLogLevel ( ) const
pure virtual

Gets the log level for the logger instance.

Returns
the current minimum log level to filter out log messages at

◆ GetLogName()

virtual const char * AZ::ILogger::GetLogName ( ) const
pure virtual

Gets the the name of the log file.

Returns
the current logfile name

◆ IsTagEnabled()

virtual bool AZ::ILogger::IsTagEnabled ( AZ::HashValue32  hashValue)
pure virtual

Queries whether the provided logging tag is enabled.

Parameters
hashValuethe hash value for the provided logging tag
Returns
boolean true if enabled

◆ SetLogLevel()

virtual void AZ::ILogger::SetLogLevel ( LogLevel  logLevel)
pure virtual

Sets the log level for the logger instance.

Parameters
logLevelthe minimum log level to filter out log messages at

◆ SetLogName()

virtual void AZ::ILogger::SetLogName ( const char *  logName)
pure virtual

Sets the the name of the log file.

Parameters
a_LogNamethe new logfile name to use

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