Struct lunatic_log::Metadata
source · pub struct Metadata { /* private fields */ }
Expand description
Metadata describing an Event.
All events have the following metadata:
- A [name], represented as a static string.
- A [target], a string that categorizes part of the system where the event or event occurred. The macros default to using the module path where the event or event originated as the target, but it may be overridden.
- A [verbosity level]. This determines how verbose a given event
is, and allows enabling or disabling more verbose diagnostics
situationally. See the documentation for the
Level
type for details. - The names of the [fields] defined by the event.
- Whether the metadata corresponds to a event.
In addition, the following optional metadata describing the source code location where the event originated may be provided:
- The [file name]
- The [line number]
- The [module path]
Implementations§
source§impl Metadata
impl Metadata
sourcepub const fn new(
name: String,
target: String,
level: Level,
module_path: Option<String>,
file: Option<String>,
line: Option<u32>
) -> Self
pub const fn new( name: String, target: String, level: Level, module_path: Option<String>, file: Option<String>, line: Option<u32> ) -> Self
Construct new metadata for a event, with a name, target, level, field names, and optional source code location.
sourcepub fn target(&self) -> &String
pub fn target(&self) -> &String
Returns a string describing the part of the system where the span or event that this metadata describes occurred.
Typically, this is the module path, but alternate targets may be set when spans or events are constructed.
sourcepub fn module_path(&self) -> Option<&String>
pub fn module_path(&self) -> Option<&String>
Returns the path to the Rust module where the span occurred, or
None
if the module path is unknown.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Metadata
impl<'de> Deserialize<'de> for Metadata
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
Auto Trait Implementations§
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
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