Macro alpm::log_action
source · macro_rules! log_action { ($handle:tt, $prefix:tt, $($arg:tt)*) => { ... }; }
Expand description
Logs a formatted message.
A wrapper around the Alpm::log_action
function that acts similar to writeln!.
Unline the Alpm::log_action
function this macro automatically appends a newline to the message.
The first argument is a handle to alpm.
The second is the message prefix. This is usually the name of your program doing the logging.
The third and following arguments are the same as format!
. The third argument must be a string
literal.
Like Alpm::log_action` this returns a Result.
Examples
log_action!(handle, "coolprogram", "starting transaction").unwrap();
log_action!(handle, "coolprogram", "installing package {}", "xorg").unwrap();
log_action!(handle, "coolprogram", "installing packages {pkg1} {pkg2}", pkg1 = "xorg", pkg2 = "git").unwrap();