Struct cwe_checker_lib::utils::log::LogMessage
source · pub struct LogMessage {
pub text: String,
pub level: LogLevel,
pub location: Option<Tid>,
pub source: Option<String>,
}
Expand description
A generic log message.
Fields§
§text: String
The log message.
level: LogLevel
The severity/type of the log message.
location: Option<Tid>
The location inside the binary that the message is related to.
source: Option<String>
The analysis where the message originated.
Implementations§
source§impl LogMessage
impl LogMessage
sourcepub fn new_info(text: impl Into<String>) -> LogMessage
pub fn new_info(text: impl Into<String>) -> LogMessage
Create a new Info
-level log message
sourcepub fn new_debug(text: impl Into<String>) -> LogMessage
pub fn new_debug(text: impl Into<String>) -> LogMessage
Create a new Debug
-level log message
sourcepub fn new_error(text: impl Into<String>) -> LogMessage
pub fn new_error(text: impl Into<String>) -> LogMessage
Create a new Error
-level log message
sourcepub fn location(self, location: Tid) -> LogMessage
pub fn location(self, location: Tid) -> LogMessage
Associate a specific location to the log message.
sourcepub fn source(self, source: impl Into<String>) -> LogMessage
pub fn source(self, source: impl Into<String>) -> LogMessage
Set the name of the source analysis for the log message.
Trait Implementations§
source§impl Clone for LogMessage
impl Clone for LogMessage
source§fn clone(&self) -> LogMessage
fn clone(&self) -> LogMessage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LogMessage
impl Debug for LogMessage
source§impl<'de> Deserialize<'de> for LogMessage
impl<'de> Deserialize<'de> for LogMessage
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for LogMessage
impl Display for LogMessage
source§impl From<LogMessage> for LogThreadMsg
impl From<LogMessage> for LogThreadMsg
source§fn from(msg: LogMessage) -> Self
fn from(msg: LogMessage) -> Self
Converts to this type from the input type.
source§impl Hash for LogMessage
impl Hash for LogMessage
source§impl Ord for LogMessage
impl Ord for LogMessage
source§fn cmp(&self, other: &LogMessage) -> Ordering
fn cmp(&self, other: &LogMessage) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for LogMessage
impl PartialEq for LogMessage
source§fn eq(&self, other: &LogMessage) -> bool
fn eq(&self, other: &LogMessage) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for LogMessage
impl PartialOrd for LogMessage
source§fn partial_cmp(&self, other: &LogMessage) -> Option<Ordering>
fn partial_cmp(&self, other: &LogMessage) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for LogMessage
impl Serialize for LogMessage
impl Eq for LogMessage
impl StructuralEq for LogMessage
impl StructuralPartialEq for LogMessage
Auto Trait Implementations§
impl RefUnwindSafe for LogMessage
impl Send for LogMessage
impl Sync for LogMessage
impl Unpin for LogMessage
impl UnwindSafe for LogMessage
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.