pub struct LogSection {
pub mode: LogMode,
pub encoding: LogEncoding,
pub level: String,
pub path: PathBuf,
pub rotation: RotationPolicy,
pub compress: bool,
pub keep_days: u64,
pub max_backups: usize,
pub max_size_mb: u64,
pub ansi: bool,
}Expand description
Serializable logging section modelled after go-zero log config.
Fields§
§mode: LogModeDestination mode: console, file, or volume.
encoding: LogEncodingLog format: plain or json.
level: StringEnv filter directive. RUST_LOG takes precedence when set.
path: PathBufDirectory used by file-backed modes.
rotation: RotationPolicyRotation policy: daily or size.
compress: boolWhether rotated logs are compressed as gzip.
keep_days: u64Number of days to retain rotated logs. 0 disables age cleanup.
max_backups: usizeMaximum number of rotated files to retain. 0 disables count cleanup.
max_size_mb: u64Size rotation boundary in MiB. 0 uses a practical default for size rotation.
ansi: boolEmit ANSI colors for console plain logs.
Implementations§
Source§impl LogSection
impl LogSection
Sourcepub fn to_log_config(&self, service_name: &str) -> LogConfig
pub fn to_log_config(&self, service_name: &str) -> LogConfig
Converts this serializable section into runtime logging config.
Trait Implementations§
Source§impl Clone for LogSection
impl Clone for LogSection
Source§fn clone(&self) -> LogSection
fn clone(&self) -> LogSection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 LogSection
impl Debug for LogSection
Source§impl Default for LogSection
impl Default for LogSection
Source§impl<'de> Deserialize<'de> for LogSectionwhere
LogSection: Default,
impl<'de> Deserialize<'de> for LogSectionwhere
LogSection: Default,
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 PartialEq for LogSection
impl PartialEq for LogSection
Source§fn eq(&self, other: &LogSection) -> bool
fn eq(&self, other: &LogSection) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for LogSection
impl StructuralPartialEq for LogSection
Auto Trait Implementations§
impl Freeze for LogSection
impl RefUnwindSafe for LogSection
impl Send for LogSection
impl Sync for LogSection
impl Unpin for LogSection
impl UnsafeUnpin for LogSection
impl UnwindSafe for LogSection
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request