Lines Matching full:log
16 /// The `Log` enum provides a Rust abstraction for logging errors, corresponding
18 pub enum Log { enum
19 /// Log invalid access caused by the guest.
23 /// Log guest access of unimplemented functionality.
29 /// locks the log file, and dropping it (letting it go out of scope) unlocks
40 /// The log file is locked while the guard exists, ensuring that there
43 /// Return `None` if the log file is closed and could not be opened.
50 /// # use qemu_api::log::LogGuard;
52 /// if let Some(mut log) = LogGuard::new() {
53 /// writeln!(log, "test");
61 /// Writes a formatted string into the log, returning any error encountered.
70 if let Some(mut log) = Self::new() { in log_fmt()
71 log.write_fmt(args)?; in log_fmt()
99 /// A macro to log messages conditionally based on a provided mask.
102 /// log level and, if so, formats and logs the message. It is the Rust
105 /// Errors from writing to the log are ignored.
109 /// - `$mask`: A log level mask. This should be a variant of the `Log` enum.
111 /// macro. It specifies the structure of the log message.
117 /// use qemu_api::{log::Log, log_mask_ln};
120 /// log_mask_ln!(Log::GuestError, "Address 0x{error_address:x} out of range");
127 /// use qemu_api::{log::Log, log_mask_ln};
131 /// Log::GuestError,
139 // Type assertion to enforce type `Log` for $mask
140 let _: Log = $mask;
145 _ = ::qemu_api::log::LogGuard::log_fmt(