LiteFX 0.4.1.2025
Computer Graphics Engine
|
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. | |
![]() | |
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 |
![]() | |
ISink () noexcept=default | |
ISink (const ISink &)=default | |
ISink (ISink &&) noexcept=default | |
ISink & | operator= (const ISink &)=default |
ISink & | operator= (ISink &&) noexcept=default |
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.
TerminationSink::TerminationSink | ( | const LogLevel & | level = LogLevel::Info, |
int | status = static_cast<int>(DEFAULT_TERMINATION_STATUS) ) |
Creates a new exception sink instance.
level | The minimum log level at which an exception is thrown. |
status | The status code used to exit the application. |
|
overridedefaultnoexcept |
|
delete |
|
deletenoexcept |
|
overrideprotectedvirtual |
Implements LiteFX::Logging::ISink.
|
overridevirtual |
Gets the minimum log level for messages to get written to the log.
Implements LiteFX::Logging::ISink.
|
overridevirtual |
Gets the name of the sink.
Implements LiteFX::Logging::ISink.
|
overridevirtual |
Gets the pattern used to format the messages for the sink.
Implements LiteFX::Logging::ISink.
|
delete |
|
deletenoexcept |
|
staticconstexpr |
The default status code used to exit the application.