pub struct LoggingConfigBuilder {
console: Option<Option<String>>,
journald: Option<Option<String>>,
syslog: Option<Option<String>>,
opentelemetry: OpentelemetryConfigBuilder,
tokio_console: TokioConsoleConfigBuilder,
files: LogfileListBuilder,
log_sensitive_information: Option<bool>,
protocol_warnings: Option<bool>,
time_granularity: Option<Duration>,
}Expand description
A builder to create an instance of LoggingConfig.
Fields§
§console: Option<Option<String>>In-progress value for console.
journald: Option<Option<String>>In-progress value for journald.
syslog: Option<Option<String>>In-progress value for syslog.
opentelemetry: OpentelemetryConfigBuilderIn-progress value for opentelemetry.
tokio_console: TokioConsoleConfigBuilderIn-progress value for tokio_console.
files: LogfileListBuilderIn-progress value for files.
log_sensitive_information: Option<bool>In-progress value for log_sensitive_information.
protocol_warnings: Option<bool>In-progress value for protocol_warnings.
time_granularity: Option<Duration>In-progress value for time_granularity.
Implementations§
Source§impl LoggingConfigBuilder
impl LoggingConfigBuilder
Sourcepub fn console(&mut self, val: impl OptionStringOrStr) -> &mut Self
pub fn console(&mut self, val: impl OptionStringOrStr) -> &mut Self
Provide a value for console.
If no value is provided for console, build will use Default::default().
For convenience, this function accepts String, &str, Option<String>, and Option<&str>.
§console
Filtering directives that determine tracing levels as described at https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/targets/struct.Targets.html#impl-FromStr
You can override this setting with the -l, –log-level command line parameter.
Example: “info,tor_proto::channel=trace”
Sourcepub fn journald(&mut self, val: impl OptionStringOrStr) -> &mut Self
pub fn journald(&mut self, val: impl OptionStringOrStr) -> &mut Self
Provide a value for journald.
For convenience, this function accepts String, &str, Option<String>, and Option<&str>.
§journald
Filtering directives for the journald logger.
Only takes effect if Arti is built with the journald filter.
Sourcepub fn syslog(&mut self, val: impl OptionStringOrStr) -> &mut Self
pub fn syslog(&mut self, val: impl OptionStringOrStr) -> &mut Self
Sourcepub fn opentelemetry(&mut self) -> &mut OpentelemetryConfigBuilder
pub fn opentelemetry(&mut self) -> &mut OpentelemetryConfigBuilder
Return a mutable reference to the inner builder for opentelemetry.
§opentelemetry
Configuration for logging spans with OpenTelemetry.
Sourcepub fn tokio_console(&mut self) -> &mut TokioConsoleConfigBuilder
pub fn tokio_console(&mut self) -> &mut TokioConsoleConfigBuilder
Return a mutable reference to the inner builder for tokio_console.
§tokio_console
Configuration for passing information to tokio-console.
Sourcepub fn log_sensitive_information(&mut self, val: bool) -> &mut Self
pub fn log_sensitive_information(&mut self, val: bool) -> &mut Self
Provide a value for log_sensitive_information.
If no value is provided for log_sensitive_information, build will use Default::default().
§log_sensitive_information
If set to true, we disable safe logging on all logs, and store
potentially sensitive information at level info or higher.
This can be useful for debugging, but it increases the value of your logs to an attacker. Do not turn this on in production unless you have a good log rotation mechanism.
Sourcepub fn protocol_warnings(&mut self, val: bool) -> &mut Self
pub fn protocol_warnings(&mut self, val: bool) -> &mut Self
Sourcepub fn time_granularity(&mut self, val: Duration) -> &mut Self
pub fn time_granularity(&mut self, val: Duration) -> &mut Self
Provide a value for time_granularity.
If no value is provided for time_granularity, build will use Default::default().
§time_granularity
An approximate granularity with which log times should be displayed.
This value controls every log time that arti outputs; it doesn’t have any
effect on times written by other logging programs like journald.
We may round this value up for convenience: For example, if you say “2.5s”, we may treat it as if you had said “3s.”
The default is “1s”, or one second.
Source§impl LoggingConfigBuilder
impl LoggingConfigBuilder
Sourcepub fn files(
&mut self,
) -> &mut Vec<<<Vec<LogfileConfig> as ShouldUseListBuilder>::Element as BuildableTrait>::Builder>
pub fn files( &mut self, ) -> &mut Vec<<<Vec<LogfileConfig> as ShouldUseListBuilder>::Element as BuildableTrait>::Builder>
Access the being-built list (resolving default)
If the field has not yet been set or accessed, the default list will be constructed and a mutable reference to the now-defaulted list of builders will be returned.
Sourcepub fn set_files(
&mut self,
list: Vec<<<Vec<LogfileConfig> as ShouldUseListBuilder>::Element as BuildableTrait>::Builder>,
)
pub fn set_files( &mut self, list: Vec<<<Vec<LogfileConfig> as ShouldUseListBuilder>::Element as BuildableTrait>::Builder>, )
Set the whole list (overriding the default)
Sourcepub fn opt_files(
&self,
) -> &Option<Vec<<<Vec<LogfileConfig> as ShouldUseListBuilder>::Element as BuildableTrait>::Builder>>
pub fn opt_files( &self, ) -> &Option<Vec<<<Vec<LogfileConfig> as ShouldUseListBuilder>::Element as BuildableTrait>::Builder>>
Inspect the being-built list (with default unresolved)
If the list has not yet been set, or accessed, &None is returned.
Sourcepub fn opt_files_mut(
&mut self,
) -> &mut Option<Vec<<<Vec<LogfileConfig> as ShouldUseListBuilder>::Element as BuildableTrait>::Builder>>
pub fn opt_files_mut( &mut self, ) -> &mut Option<Vec<<<Vec<LogfileConfig> as ShouldUseListBuilder>::Element as BuildableTrait>::Builder>>
Mutably access the being-built list (with default unresolved)
If the list has not yet been set, or accessed, &mut None is returned.
Source§impl LoggingConfigBuilder
impl LoggingConfigBuilder
Sourcepub fn build(&self) -> Result<LoggingConfig, ConfigBuildError>
pub fn build(&self) -> Result<LoggingConfig, ConfigBuildError>
Try to construct a new LoggingConfig from the fields set in this builder.
Return an error if any required field is missing, or is set to something invalid.
Trait Implementations§
Source§impl Builder for LoggingConfigBuilder
impl Builder for LoggingConfigBuilder
Source§type Built = LoggingConfig
type Built = LoggingConfig
Source§fn build(&self) -> Result<LoggingConfig, ConfigBuildError>
fn build(&self) -> Result<LoggingConfig, ConfigBuildError>
Built Read moreSource§impl Clone for LoggingConfigBuilder
impl Clone for LoggingConfigBuilder
Source§fn clone(&self) -> LoggingConfigBuilder
fn clone(&self) -> LoggingConfigBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LoggingConfigBuilder
impl Debug for LoggingConfigBuilder
Source§impl Default for LoggingConfigBuilder
impl Default for LoggingConfigBuilder
Source§fn default() -> LoggingConfigBuilder
fn default() -> LoggingConfigBuilder
Source§impl<'de> Deserialize<'de> for LoggingConfigBuilder
impl<'de> Deserialize<'de> for LoggingConfigBuilder
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>,
Source§impl ExtendBuilder for LoggingConfigBuilder
impl ExtendBuilder for LoggingConfigBuilder
Source§fn extend_from(&mut self, other: Self, strategy: ExtendStrategy)
fn extend_from(&mut self, other: Self, strategy: ExtendStrategy)
Source§impl Flattenable for LoggingConfigBuilder
impl Flattenable for LoggingConfigBuilder
Auto Trait Implementations§
impl Freeze for LoggingConfigBuilder
impl RefUnwindSafe for LoggingConfigBuilder
impl Send for LoggingConfigBuilder
impl Sync for LoggingConfigBuilder
impl Unpin for LoggingConfigBuilder
impl UnsafeUnpin for LoggingConfigBuilder
impl UnwindSafe for LoggingConfigBuilder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
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>
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>
T in a tonic::RequestSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> PossiblyOption<T> for T
impl<T> PossiblyOption<T> for T
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.