36inline void LogError(
const Error &error,
double time = 0.0,
const std::string &component =
"") {
41 if (!component.empty()) {
59[[noreturn]]
void ThrowAndLog(E &&error,
double time = 0.0,
const std::string &component =
"") {
61 throw std::forward<E>(error);
76#define ICARUS_THROW_LOG(error) ::icarus::ThrowAndLog((error), 0.0, "")
84#define ICARUS_THROW_LOG_CTX(error, time, component) \
85 ::icarus::ThrowAndLog((error), (time), (component))
Consolidated error handling for Icarus.
Unified logging service for Icarus.
Base class for all Icarus exceptions.
Definition Error.hpp:52
SimulationError toSimulationError(double time=0.0, const std::string &component="") const
Convert to SimulationError for ErrorHandler integration.
Definition Error.hpp:63
void Log(LogLevel level, double sim_time, std::string_view message)
Log a message (uses current thread-local context).
Definition LogService.hpp:352
Definition AggregationTypes.hpp:13
void ThrowAndLog(E &&error, double time=0.0, const std::string &component="")
Throw an error after logging it.
Definition ErrorLogging.hpp:59
Severity
Definition Error.hpp:22
@ WARNING
Warning (may trigger graceful degradation).
Definition Error.hpp:24
@ FATAL
Fatal (simulation must stop).
Definition Error.hpp:26
@ INFO
Informational (logged, no action).
Definition Error.hpp:23
@ ERROR
Error (simulation may continue with fallback).
Definition Error.hpp:25
LogLevel SeverityToLogLevel(Severity severity)
Convert error severity to log level.
Definition ErrorLogging.hpp:19
void LogError(const Error &error, double time=0.0, const std::string &component="")
Log an error to the global LogService.
Definition ErrorLogging.hpp:36
LogLevel
Log severity levels.
Definition Console.hpp:35
@ Warning
Potential issues.
Definition Console.hpp:40
@ Info
Normal operation.
Definition Console.hpp:38
@ Fatal
Unrecoverable errors.
Definition Console.hpp:42
@ Error
Recoverable errors.
Definition Console.hpp:41
LogService & GetLogService()
Global log service singleton.
Definition LogService.hpp:536
Immutable log context - set by component/entity during execution.
Definition LogService.hpp:98
std::string component
Component name (e.g., "merlinEngine2").
Definition LogService.hpp:100