Skip to main content

FmtLayer

Struct FmtLayer 

Source
pub struct FmtLayer {
Show 15 fields pub filter: Option<String>, pub writer: String, pub formatter: FmtLayerFormatter, pub span_events: SpanEvents, pub ansi: bool, pub time: Option<bool>, pub level: Option<bool>, pub target: Option<bool>, pub file: Option<bool>, pub line_number: Option<bool>, pub thread_ids: Option<bool>, pub thread_names: Option<bool>, pub span_list: Option<bool>, pub current_span: Option<bool>, pub flatten_event: Option<bool>,
}
Expand description

fmt Layer (see docs) configuration.

§Example

# declare a layer named "app"
[layer.app]
type = "fmt"
writer = "my_file" # must be a declared writer
formatter =  "pretty" # can be : "full", "compact", "pretty", "json"
span_events = "none" # can be : "new", "enter", "exit", "close", "none", "active", "full"
ansi = false # color terminal
# the following properties are optional
filter = "only_app" # must be a named filter
time = true
level = true
target = true
file = true
line_number = true
thread_ids = true
thread_names = true
span_list = true # for "json" formatter only
current_span = true # for "json" formatter only
flatten_event = true # for "json" formatter only

Fields§

§filter: Option<String>

Applies a per Layer filter, makes this a Filtered Layer

§writer: String

Where does the output go

§formatter: FmtLayerFormatter

Formatting kind/type

§span_events: SpanEvents

Which span events should be recorded

§ansi: bool

Ansi color escape codes (for color terminal) recommend to disable if writer is file

§time: Option<bool>

Record time

§level: Option<bool>

Record level

§target: Option<bool>

Record span/event target

§file: Option<bool>

Record source file

§line_number: Option<bool>

Record source file line number

§thread_ids: Option<bool>

Record thread id

§thread_names: Option<bool>

Record thread name

§span_list: Option<bool>

Record span list (json formatter only)

§current_span: Option<bool>

Record current span (json formatter only)

§flatten_event: Option<bool>

Flatten json output (json formatter only)

Trait Implementations§

Source§

impl Clone for FmtLayer

Source§

fn clone(&self) -> FmtLayer

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FmtLayer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for FmtLayer

Source§

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 PartialEq for FmtLayer

Source§

fn eq(&self, other: &FmtLayer) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for FmtLayer

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for FmtLayer

Source§

impl StructuralPartialEq for FmtLayer

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,