pub trait FormatTrait:
Display
+ DynClone
+ Send
+ Sync {
// Required method
fn format(&self, log_entry: &LogEntry) -> String;
// Provided method
fn ft_fmt(
&self,
dt_fmt: String,
fmt: String,
log_entry: &LogEntry,
) -> String { ... }
}Expand description
Provides methods for formatting LogEntrys.
Required Methods§
Provided Methods§
Sourcefn ft_fmt(&self, dt_fmt: String, fmt: String, log_entry: &LogEntry) -> String
fn ft_fmt(&self, dt_fmt: String, fmt: String, log_entry: &LogEntry) -> String
This method does the actual formatting of the log_entry.
§Parameters
dt_fmt- Thechrono::DateTimeformat string.fmt- The primary format string.
Available variables:mod_path- The module path, possibly supplied via:module_path!().fn_name- The name of the function/method inside which the log entry was generated. Supplied by the#[logger]macro, or manually with theset_fn_name()method instead.level- The log level for which the entry was created.message- The text of the log entry.