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::Debug::TraceMessageEvents Class Reference

#include <TraceMessageBus.h>

Inherits AZ::EBusTraits.

Public Types

typedef AZStd::recursive_mutex MutexType
 
typedef OSStdAllocator AllocatorType
 
- Public Types inherited from AZ::EBusTraits
using AllocatorType = AZ::Internal::EBusEnvironmentAllocator
 
using BusIdType = NullBusId
 
using BusIdOrderCompare = NullBusIdCompare
 
using BusHandlerOrderCompare = BusHandlerCompareDefault
 
using MutexType = NullMutex
 
using EventQueueMutexType = NullMutex
 
template<class Bus >
using ConnectionPolicy = EBusConnectionPolicy< Bus >
 
template<class Context >
using StoragePolicy = EBusEnvironmentStoragePolicy< Context >
 
template<class Bus >
using RouterPolicy = EBusRouterPolicy< Bus >
 
using EventProcessingPolicy = EBusEventProcessingPolicy
 
template<typename DispatchMutex , bool IsLocklessDispatch>
using DispatchLockGuard = AZStd::conditional_t< IsLocklessDispatch, AZ::Internal::NullLockGuard< DispatchMutex >, AZStd::scoped_lock< DispatchMutex > >
 
template<typename ContextMutex >
using ConnectLockGuard = AZStd::conditional_t< AZStd::is_same_v< ContextMutex, AZ::NullMutex >, AZ::Internal::NullLockGuard< ContextMutex >, AZStd::unique_lock< ContextMutex > >
 
template<typename ContextMutex >
using BindLockGuard = AZStd::scoped_lock< ContextMutex >
 
template<typename ContextMutex >
using CallstackTrackerLockGuard = AZStd::conditional_t< AZStd::is_same_v< ContextMutex, AZ::NullMutex >, AZ::Internal::NullLockGuard< ContextMutex >, AZStd::unique_lock< ContextMutex > >
 

Public Member Functions

virtual bool OnPreAssert (const char *, int, const char *, const char *)
 
virtual bool OnAssert (const char *)
 
virtual bool OnException (const char *)
 
virtual bool OnPreError (const char *, const char *, int, const char *, const char *)
 
virtual bool OnError (const char *, const char *)
 
virtual bool OnPreWarning (const char *, const char *, int, const char *, const char *)
 
virtual bool OnWarning (const char *, const char *)
 
virtual bool OnPrintf (const char *, const char *)
 
virtual bool OnOutput (const char *, const char *)
 

Additional Inherited Members

- Static Public Attributes inherited from AZ::EBusTraits
static constexpr EBusHandlerPolicy HandlerPolicy = EBusHandlerPolicy::Multiple
 
static constexpr EBusAddressPolicy AddressPolicy = EBusAddressPolicy::Single
 
static constexpr bool EnableEventQueue = false
 
static constexpr bool EventQueueingActiveByDefault = true
 
static constexpr bool EnableQueuedReferences = false
 
static constexpr bool LocklessDispatch = false
 
- Protected Member Functions inherited from AZ::EBusTraits
 ~EBusTraits ()=default
 

Detailed Description

Trace messages event handle. Whenever code invokes AZ_TracePrintf / AZ_Warning / AZ_Assert / AZ_Error and similar macros this bus gets invoked and is an ideal place to put logging sinks / displays. All messages are optional (they have default implementation) and you can handle only one at a time. Most messages return a boolean, if false means all the default handling will be executed (callstack, details, etc.) if returned true only a minimal amount of data will be output (that's critical). For example: Asserts will always print a header, so no matter what you return we will have a minimal indication an assert is triggered.

Member Function Documentation

◆ OnException()

virtual bool AZ::Debug::TraceMessageEvents::OnException ( const char *  )
inlinevirtual

Exception handling is only invoked in the case of an actual OS-level exception. If any handlers return true, the program will be allowed to continue running despite the exception and no callstack will be emitted. If all handlers return false, the OS will be given the exception, (as well as any other exception handlers).

◆ OnOutput()

virtual bool AZ::Debug::TraceMessageEvents::OnOutput ( const char *  ,
const char *   
)
inlinevirtual

All trace functions you output to anything. So if you want to handle all the output this is the place. Do not return true and disable the system output if you listen at that level. Otherwise we can trigger an assert without even one line of message send to the console/debugger.


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