pub struct LogMessage {
pub state: MessageState,
pub message: HSTRING,
}Expand description
Struct which represents a log message.
The ILogMessage interface represents a log message in the Command Palette. It is used to provide information about the state of the application or specific operations, and can be used for debugging or informational purposes.
Fields§
§state: MessageStateThe state of the log message. This property indicates the severity or type of the log message, such as informational, warning, or error. The MessageState will specify the type.
message: HSTRINGThe message text that describes the log entry.
Implementations§
Source§impl LogMessage
impl LogMessage
Sourcepub const fn into_static(self) -> StaticComObject<Self>
pub const fn into_static(self) -> StaticComObject<Self>
This converts a partially-constructed COM object (in the sense that it contains
application state but does not yet have vtable and reference count constructed)
into a StaticComObject. This allows the COM object to be stored in static
(global) variables.
Source§impl LogMessage
impl LogMessage
Sourcepub fn new(state: MessageState, message: HSTRING) -> Self
pub fn new(state: MessageState, message: HSTRING) -> Self
Creates a new LogMessage.
Sourcepub fn info(message: HSTRING) -> Self
pub fn info(message: HSTRING) -> Self
Creates a new LogMessage that represents an informational message.
Sourcepub fn success(message: HSTRING) -> Self
pub fn success(message: HSTRING) -> Self
Creates a new LogMessage that represents a success message.
Sourcepub fn warning(message: HSTRING) -> Self
pub fn warning(message: HSTRING) -> Self
Creates a new LogMessage that represents a warning message.
Sourcepub fn error(message: HSTRING) -> Self
pub fn error(message: HSTRING) -> Self
Creates a new LogMessage that represents an error message.
Sourcepub fn log(self)
pub fn log(self)
Logs the message to the host.
The message will be logged into the log file, yet not shown to the user.
This method is a convenient wrapper around the log_message function,
it consumes self, so clone the struct if you want to log it multiple times.
Trait Implementations§
Source§impl AsImpl<LogMessage> for ILogMessage
impl AsImpl<LogMessage> for ILogMessage
Source§impl Clone for LogMessage
impl Clone for LogMessage
Source§fn clone(&self) -> LogMessage
fn clone(&self) -> LogMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ComObjectInner for LogMessage
impl ComObjectInner for LogMessage
Source§type Outer = LogMessage_Impl
type Outer = LogMessage_Impl
<foo>_Impl type (aka the “boxed” type or “outer” type).