pub struct LogConfig {
pub level: String,
pub format: LogFormat,
pub target: LogTarget,
pub file: FileLogConfig,
pub timestamps: bool,
pub file_info: bool,
pub thread_ids: bool,
pub thread_names: bool,
pub span_events: bool,
pub ansi: bool,
pub directives: Vec<String>,
}Expand description
Logging configuration.
Fields§
§level: StringLog level filter (e.g., “info”, “debug”, “trace”).
format: LogFormatLog format.
target: LogTargetLog target.
file: FileLogConfigFile logging configuration (used when target is File).
timestamps: boolWhether to include timestamps.
file_info: boolWhether to include file/line info.
thread_ids: boolWhether to include thread IDs.
thread_names: boolWhether to include thread names.
span_events: boolWhether to include span events.
ansi: boolWhether to use ANSI colors.
directives: Vec<String>Directive overrides (e.g., astrid_mcp=debug).
Implementations§
Source§impl LogConfig
impl LogConfig
Sourcepub fn with_format(self, format: LogFormat) -> Self
pub fn with_format(self, format: LogFormat) -> Self
Set the log format.
Sourcepub fn with_target(self, target: LogTarget) -> Self
pub fn with_target(self, target: LogTarget) -> Self
Set the log target.
Sourcepub fn with_file_logging(
self,
directory: impl Into<PathBuf>,
prefix: impl Into<String>,
) -> Self
pub fn with_file_logging( self, directory: impl Into<PathBuf>, prefix: impl Into<String>, ) -> Self
Configure file logging with daily rotation.
Sourcepub fn with_file_logging_rotation(
self,
directory: impl Into<PathBuf>,
prefix: impl Into<String>,
rotation: FileRotation,
) -> Self
pub fn with_file_logging_rotation( self, directory: impl Into<PathBuf>, prefix: impl Into<String>, rotation: FileRotation, ) -> Self
Configure file logging with custom rotation.
Sourcepub fn with_directive(self, directive: impl Into<String>) -> Self
pub fn with_directive(self, directive: impl Into<String>) -> Self
Add a directive override.
Sourcepub fn without_timestamps(self) -> Self
pub fn without_timestamps(self) -> Self
Disable timestamps.
Sourcepub fn with_file_info(self) -> Self
pub fn with_file_info(self) -> Self
Enable file/line info.
Sourcepub fn with_span_events(self) -> Self
pub fn with_span_events(self) -> Self
Enable span events.
Sourcepub fn without_ansi(self) -> Self
pub fn without_ansi(self) -> Self
Disable ANSI colors.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LogConfig
impl<'de> Deserialize<'de> for LogConfig
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 Freeze for LogConfig
impl RefUnwindSafe for LogConfig
impl Send for LogConfig
impl Sync for LogConfig
impl Unpin for LogConfig
impl UnsafeUnpin for LogConfig
impl UnwindSafe for LogConfig
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