LiteFX 0.4.1.2025
Computer Graphics Engine
Loading...
Searching...
No Matches
LiteFX::Logging::TerminationSink Class Reference

Forcefully terminates the application, if a log message of a certain level or higher is output. More...

#include <logging.hpp>

Inherits LiteFX::Logging::ISink.

Classes

class  TerminationSinkImpl
 

Public Member Functions

 TerminationSink (const LogLevel &level=LogLevel::Info, int status=static_cast< int >(DEFAULT_TERMINATION_STATUS))
 Creates a new exception sink instance.
 
 ~TerminationSink () noexcept override
 
 TerminationSink (const TerminationSink &)=delete
 
 TerminationSink (TerminationSink &&) noexcept=delete
 
auto operator= (const TerminationSink &)=delete
 
auto operator= (TerminationSink &&) noexcept=delete
 
LogLevel getLevel () const override
 Gets the minimum log level for messages to get written to the log.
 
String getName () const override
 Gets the name of the sink.
 
String getPattern () const override
 Gets the pattern used to format the messages for the sink.
 
- Public Member Functions inherited from LiteFX::Logging::ISink
virtual ~ISink () noexcept=default
 

Static Public Attributes

static constexpr std::uint32_t DEFAULT_TERMINATION_STATUS = 0xFF455252
 The default status code used to exit the application.
 

Protected Member Functions

spdlog::sink_ptr get () const override
 
- Protected Member Functions inherited from LiteFX::Logging::ISink
 ISink () noexcept=default
 
 ISink (const ISink &)=default
 
 ISink (ISink &&) noexcept=default
 
ISinkoperator= (const ISink &)=default
 
ISinkoperator= (ISink &&) noexcept=default
 

Detailed Description

Forcefully terminates the application, if a log message of a certain level or higher is output.

The purpose of this sink is to allow tests to catch errors during application runtime. You probably do not want to use this sink in an actual application.

Constructor & Destructor Documentation

◆ TerminationSink() [1/3]

TerminationSink::TerminationSink ( const LogLevel & level = LogLevel::Info,
int status = static_cast<int>(DEFAULT_TERMINATION_STATUS) )

Creates a new exception sink instance.

Parameters
levelThe minimum log level at which an exception is thrown.
statusThe status code used to exit the application.

◆ ~TerminationSink()

TerminationSink::~TerminationSink ( )
overridedefaultnoexcept

◆ TerminationSink() [2/3]

LiteFX::Logging::TerminationSink::TerminationSink ( const TerminationSink & )
delete

◆ TerminationSink() [3/3]

LiteFX::Logging::TerminationSink::TerminationSink ( TerminationSink && )
deletenoexcept

Member Function Documentation

◆ get()

spdlog::sink_ptr TerminationSink::get ( ) const
overrideprotectedvirtual

◆ getLevel()

LogLevel TerminationSink::getLevel ( ) const
overridevirtual

Gets the minimum log level for messages to get written to the log.

Implements LiteFX::Logging::ISink.

◆ getName()

String TerminationSink::getName ( ) const
overridevirtual

Gets the name of the sink.

Implements LiteFX::Logging::ISink.

◆ getPattern()

String TerminationSink::getPattern ( ) const
overridevirtual

Gets the pattern used to format the messages for the sink.

Implements LiteFX::Logging::ISink.

◆ operator=() [1/2]

auto LiteFX::Logging::TerminationSink::operator= ( const TerminationSink & )
delete

◆ operator=() [2/2]

auto LiteFX::Logging::TerminationSink::operator= ( TerminationSink && )
deletenoexcept

Member Data Documentation

◆ DEFAULT_TERMINATION_STATUS

std::uint32_t LiteFX::Logging::TerminationSink::DEFAULT_TERMINATION_STATUS = 0xFF455252
staticconstexpr

The default status code used to exit the application.