pub struct LoggingConfig {
pub log_dir: PathBuf,
pub file_format: LogFormat,
pub stderr_format: LogFormat,
pub output: LogOutput,
}Expand description
Configuration for logging system initialization
This struct represents the domain-specific logging configuration that is independent of CLI parsing concerns. It can be constructed from CLI arguments or other configuration sources without creating circular dependencies.
§Design Principles
- Independence: No dependency on presentation layer types
- Reusability: Can be constructed from various sources (CLI, config files, tests)
- Clarity: Clear field names and comprehensive documentation
Fields§
§log_dir: PathBufDirectory where log files will be written
file_format: LogFormatFormat for file logging output
stderr_format: LogFormatFormat for stderr logging output
output: LogOutputOutput target (file-only vs file-and-stderr)
Implementations§
Source§impl LoggingConfig
impl LoggingConfig
Sourcepub fn new(
log_dir: PathBuf,
file_format: LogFormat,
stderr_format: LogFormat,
output: LogOutput,
) -> Self
pub fn new( log_dir: PathBuf, file_format: LogFormat, stderr_format: LogFormat, output: LogOutput, ) -> Self
Create a new logging configuration
§Arguments
log_dir- Directory for log filesfile_format- Format for file outputstderr_format- Format for stderr outputoutput- Output target configuration
Trait Implementations§
Source§impl Clone for LoggingConfig
impl Clone for LoggingConfig
Auto Trait Implementations§
impl Freeze for LoggingConfig
impl RefUnwindSafe for LoggingConfig
impl Send for LoggingConfig
impl Sync for LoggingConfig
impl Unpin for LoggingConfig
impl UnsafeUnpin for LoggingConfig
impl UnwindSafe for LoggingConfig
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<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