pub struct OsLogLayer { /* private fields */ }Expand description
A composable [tracing_subscriber::Layer] that writes to Apple unified
logging.
Implementations§
Source§impl OsLogLayer
impl OsLogLayer
Sourcepub fn new(
subsystem: impl AsRef<str>,
category: impl AsRef<str>,
) -> Result<Self, OsLogError>
pub fn new( subsystem: impl AsRef<str>, category: impl AsRef<str>, ) -> Result<Self, OsLogError>
Create a layer for one fixed Apple subsystem/category pair.
Apple caches these pairs for the lifetime of the process, so callers should create a small, fixed set rather than derive categories from request or span data.
Sourcepub fn with_privacy(self, privacy: Privacy) -> Self
pub fn with_privacy(self, privacy: Privacy) -> Self
Set the privacy applied to all dynamic text emitted by this layer.
Sourcepub fn set_privacy(&mut self, privacy: Privacy) -> &mut Self
pub fn set_privacy(&mut self, privacy: Privacy) -> &mut Self
Set the privacy applied to all dynamic text emitted by this layer.
Sourcepub fn with_span_mode(self, span_mode: SpanMode) -> Self
pub fn with_span_mode(self, span_mode: SpanMode) -> Self
Configure native signpost export for spans.
Defaults to SpanMode::Signposts.
Sourcepub fn set_span_mode(&mut self, span_mode: SpanMode) -> &mut Self
pub fn set_span_mode(&mut self, span_mode: SpanMode) -> &mut Self
Configure native signpost export for spans.
Defaults to SpanMode::Signposts.
Sourcepub fn with_level_map(self, level_map: LevelMap) -> Self
pub fn with_level_map(self, level_map: LevelMap) -> Self
Set the tracing-to-Apple level mapping.
Sourcepub fn set_level_map(&mut self, level_map: LevelMap) -> &mut Self
pub fn set_level_map(&mut self, level_map: LevelMap) -> &mut Self
Set the tracing-to-Apple level mapping.
Sourcepub fn with_target(self, include_target: bool) -> Self
pub fn with_target(self, include_target: bool) -> Self
Include or omit the tracing target in event and signpost messages.
Sourcepub fn set_target(&mut self, include_target: bool) -> &mut Self
pub fn set_target(&mut self, include_target: bool) -> &mut Self
Include or omit the tracing target in event and signpost messages.
Sourcepub fn with_span_context(self, include_span_context: bool) -> Self
pub fn with_span_context(self, include_span_context: bool) -> Self
Include or omit the event’s explicit/contextual span path and fields.
Sourcepub fn set_span_context(&mut self, include_span_context: bool) -> &mut Self
pub fn set_span_context(&mut self, include_span_context: bool) -> &mut Self
Include or omit the event’s explicit/contextual span path and fields.
Sourcepub fn with_max_message_bytes(self, max_message_bytes: usize) -> Self
pub fn with_max_message_bytes(self, max_message_bytes: usize) -> Self
Bound the formatted dynamic payload.
Apple caps persisted dynamic content at roughly 1 KiB. Values
below three bytes are raised to three so truncation can be represented
by ....
Sourcepub fn set_max_message_bytes(&mut self, max_message_bytes: usize) -> &mut Self
pub fn set_max_message_bytes(&mut self, max_message_bytes: usize) -> &mut Self
Bound the formatted dynamic payload.
Apple caps persisted dynamic content at roughly 1 KiB. Values
below three bytes are raised to three so truncation can be represented
by ....
Trait Implementations§
Source§impl Clone for OsLogLayer
impl Clone for OsLogLayer
Source§impl Debug for OsLogLayer
impl Debug for OsLogLayer
Source§impl<S> Layer<S> for OsLogLayerwhere
S: Subscriber + for<'lookup> LookupSpan<'lookup>,
impl<S> Layer<S> for OsLogLayerwhere
S: Subscriber + for<'lookup> LookupSpan<'lookup>,
Source§fn on_new_span(&self, attrs: &Attributes<'_>, id: &Id, ctx: Context<'_, S>)
fn on_new_span(&self, attrs: &Attributes<'_>, id: &Id, ctx: Context<'_, S>)
Attributes and Id.Source§fn on_record(&self, id: &Id, values: &Record<'_>, ctx: Context<'_, S>)
fn on_record(&self, id: &Id, values: &Record<'_>, ctx: Context<'_, S>)
Id recorded the given
values.Source§fn on_event(&self, event: &Event<'_>, ctx: Context<'_, S>)
fn on_event(&self, event: &Event<'_>, ctx: Context<'_, S>)
Source§fn on_close(&self, id: Id, ctx: Context<'_, S>)
fn on_close(&self, id: Id, ctx: Context<'_, S>)
§fn on_register_dispatch(&self, subscriber: &Dispatch)
fn on_register_dispatch(&self, subscriber: &Dispatch)
Subscriber. Read more§fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest
fn register_callsite(&self, metadata: &'static Metadata<'static>) -> Interest
Subscriber::register_callsite. Read more§fn enabled(&self, metadata: &Metadata<'_>, ctx: Context<'_, S>) -> bool
fn enabled(&self, metadata: &Metadata<'_>, ctx: Context<'_, S>) -> bool
true if this layer is interested in a span or event with the
given metadata in the current [Context], similarly to
Subscriber::enabled. Read more§fn on_follows_from(&self, _span: &Id, _follows: &Id, _ctx: Context<'_, S>)
fn on_follows_from(&self, _span: &Id, _follows: &Id, _ctx: Context<'_, S>)
span recorded that it
follows from the span with the ID follows.§fn event_enabled(&self, _event: &Event<'_>, _ctx: Context<'_, S>) -> bool
fn event_enabled(&self, _event: &Event<'_>, _ctx: Context<'_, S>) -> bool
§fn on_enter(&self, _id: &Id, _ctx: Context<'_, S>)
fn on_enter(&self, _id: &Id, _ctx: Context<'_, S>)
§fn on_exit(&self, _id: &Id, _ctx: Context<'_, S>)
fn on_exit(&self, _id: &Id, _ctx: Context<'_, S>)
§fn on_id_change(&self, _old: &Id, _new: &Id, _ctx: Context<'_, S>)
fn on_id_change(&self, _old: &Id, _new: &Id, _ctx: Context<'_, S>)
§fn and_then<L>(self, layer: L) -> Layered<L, Self, S>where
L: Layer<S>,
Self: Sized,
fn and_then<L>(self, layer: L) -> Layered<L, Self, S>where
L: Layer<S>,
Self: Sized,
Layer, returning a Layered
struct implementing Layer. Read more§fn with_subscriber(self, inner: S) -> Layered<Self, S>where
Self: Sized,
fn with_subscriber(self, inner: S) -> Layered<Self, S>where
Self: Sized,
Layer with the given Subscriber, returning a
Layered struct that implements Subscriber. Read more§fn with_filter<F>(self, filter: F) -> Filtered<Self, F, S>where
Self: Sized,
F: Filter<S>,
fn with_filter<F>(self, filter: F) -> Filtered<Self, F, S>where
Self: Sized,
F: Filter<S>,
registry and std only.Auto Trait Implementations§
impl Freeze for OsLogLayer
impl RefUnwindSafe for OsLogLayer
impl Send for OsLogLayer
impl Sync for OsLogLayer
impl Unpin for OsLogLayer
impl UnsafeUnpin for OsLogLayer
impl UnwindSafe for OsLogLayer
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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 more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<V, F> ValueFormatter<&V> for F
impl<V, F> ValueFormatter<&V> for F
§fn format_value(writer: impl ValueWriter, value: &&V)
fn format_value(writer: impl ValueWriter, value: &&V)
value to writer§impl<V, F> ValueFormatter<Arc<V>> for F
impl<V, F> ValueFormatter<Arc<V>> for F
§fn format_value(writer: impl ValueWriter, value: &Arc<V>)
fn format_value(writer: impl ValueWriter, value: &Arc<V>)
value to writer§impl<V, F> ValueFormatter<Box<V>> for F
impl<V, F> ValueFormatter<Box<V>> for F
§fn format_value(writer: impl ValueWriter, value: &Box<V>)
fn format_value(writer: impl ValueWriter, value: &Box<V>)
value to writer§impl<V, F> ValueFormatter<Cow<'_, V>> for F
impl<V, F> ValueFormatter<Cow<'_, V>> for F
§fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
value to writer§impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
§fn format_value(writer: impl ValueWriter, value: &Option<V>)
fn format_value(writer: impl ValueWriter, value: &Option<V>)
value to writer