15#define PROGRAM_NAME "logging-and-asserting"
38 "This is a log message with {} arguments: {} and {}", 2,
"first-argument is a string", 0.5);
39 IRSOL_LOG_INFO(
"We can determine the precision for floating point numbers;");
68 IRSOL_LOG_INFO(
"Triggering Debug-level assertion failure. This should cause a warning message to "
69 "be printed to the console.");
72 IRSOL_LOG_INFO(
"Triggering Error-level assertion failure. This should cause an error message to "
73 "be printed to the console, and an irsol::AssertionException to be fired.");
80 IRSOL_LOG_INFO(
"Continuing after catching Error-level assertion.");
82 IRSOL_LOG_INFO(
"Triggering Fatal-level assertion failure (program will terminate)...");
86 IRSOL_LOG_INFO(
"This message will not be printed if Fatal assertion is triggered.");
Assertion macros and utilities based on the PPK_ASSERT library.
const std::string getProgramName()
Returns the program name, typically used for logging. If PROGRAM_NAME is not defined at compile time,...
void demoPassingAssertions()
void demoLoggingWithArguments()
void demoFailingAssertions()
#define IRSOL_ASSERT_DEBUG
Debug-level assertion macro.
#define IRSOL_ASSERT_ERROR
Error-level assertion macro.
void initAssertHandler()
Initializes the assertion handler system.
#define IRSOL_ASSERT_FATAL
Fatal-level assertion macro.
#define IRSOL_LOG_FATAL(...)
Logs a fatal (critical) message using the default logger.
#define IRSOL_LOG_INFO(...)
Logs an info-level message using the default logger.
#define IRSOL_NAMED_LOG_INFO(name,...)
Logs an info-level message using a named logger.
#define IRSOL_LOG_ERROR(...)
Logs an error-level message using the default logger.
#define IRSOL_LOG_WARN(...)
Logs a warning-level message using the default logger.
#define IRSOL_LOG_DEBUG(...)
Logs a debug-level message using the default logger.
#define IRSOL_LOG_TRACE(...)
Logs a trace-level message using the default logger.
void initLogging(const char *fileSinkFilename="logs/irsol.log", std::optional< spdlog::level::level_enum > minLogLevel=std::nullopt)
Initializes the irsol logging system.
Logging utilities and configuration for the irsol library.
ppk::assert::AssertionException AssertionException