Icarus
Vehicle Simulation as a Transformable Computational Graph, built on Vulcan and Janus
Loading...
Searching...
No Matches
ErrorLogging.hpp File Reference

Integration between Error types and LogService. More...

Include dependency graph for ErrorLogging.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  icarus

Macros

#define ICARUS_THROW_LOG(error)
 Throw an error after logging it to global LogService.
#define ICARUS_THROW_LOG_CTX(error, time, component)
 Throw an error with full context, logging before throw.

Functions

LogLevel icarus::SeverityToLogLevel (Severity severity)
 Convert error severity to log level.
void icarus::LogError (const Error &error, double time=0.0, const std::string &component="")
 Log an error to the global LogService.
template<typename E>
void icarus::ThrowAndLog (E &&error, double time=0.0, const std::string &component="")
 Throw an error after logging it.

Detailed Description

Integration between Error types and LogService.

Include this header to get automatic logging when throwing errors. This file bridges Error.hpp and LogService.hpp.

Macro Definition Documentation

◆ ICARUS_THROW_LOG

#define ICARUS_THROW_LOG ( error)
Value:
::icarus::ThrowAndLog((error), 0.0, "")
void ThrowAndLog(E &&error, double time=0.0, const std::string &component="")
Throw an error after logging it.
Definition ErrorLogging.hpp:59

Throw an error after logging it to global LogService.

Parameters
errorThe error to throw

◆ ICARUS_THROW_LOG_CTX

#define ICARUS_THROW_LOG_CTX ( error,
time,
component )
Value:
::icarus::ThrowAndLog((error), (time), (component))

Throw an error with full context, logging before throw.

Parameters
errorThe error to throw
timeSimulation time
componentComponent name for logging context