pub struct Config {
pub gcp_project_id: Option<String>,
pub level_filter: Option<LevelFilter>,
}
Expand description
Configuration for the GCP structured logging subscriber.
Fields§
§gcp_project_id: Option<String>
Your GCP project ID used to construct the full trace path. If None, will attempt to fetch from the GCP metadata service.
level_filter: Option<LevelFilter>
The minimum log level to emit (defaults to INFO if not specified)
Implementations§
Source§impl Config
impl Config
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new config that will auto-detect the GCP project ID from the metadata service. The log level will default to INFO.
Sourcepub fn with_project_id(gcp_project_id: impl Into<String>) -> Self
pub fn with_project_id(gcp_project_id: impl Into<String>) -> Self
Create a new config with the specified GCP project ID. The log level will default to INFO.
Sourcepub fn with_level(self, level: LevelFilter) -> Self
pub fn with_level(self, level: LevelFilter) -> Self
Set the log level filter.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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