Macro simics::error

source ·
macro_rules! error {
    ($obj:expr, $fmt:literal $($args:tt)*) => { ... };
    ($fmt:literal $($args:tt)*) => { ... };
}
Expand description

Log an error message via the SIMICS logging API.

If an object is provided, the message will be logged through that object. If not, the message will be logged through the base sim object. Note that errors logged may trigger simulator exit if the simulator is run with the -werror flag.

§Examples

use simics::error;

let module_instance = get_object("object_name")?;
let parameter = 0;

error!(module_instance, "Error message with parameter {}", parameter);
error!("Error message without object with parameter {}", parameter);

§Panics

This macro will panic of there is an error in the logging call. This is unlikely if the object is valid, but if your use case requires handling errors or is dynamically generating objects without static lifetimes, you should use the internal [log_error] API instead.

This macro will cause simulator exit, triggering a cascading panic, if it is called while the simulator is run with -werror.