Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/tokio-rs/tracing
/ functions
Functions
2,480 in github.com/tokio-rs/tracing
⨍
Functions
2,480
◇
Types & classes
463
↓ 256 callers
Method
assert_finished
Checks the expectations which were set on the [`MockSubscriber`]. Calling `assert_finished` is usually the final part of a test. # Panics This meth
tracing-mock/src/subscriber.rs:1436
↓ 251 callers
Method
run_with_handle
Consume this builder and return a [`MockLayer`] which can be set as the default subscriber and a [`MockHandle`] which can be used to validate the prov
tracing-mock/src/layer.rs:850
↓ 237 callers
Function
mock
()
tracing-mock/src/layer.rs:190
↓ 211 callers
Method
only
Indicates that no fields other than those specified should be expected. If additional fields are present on the recorded event or span, the expectati
tracing-mock/src/field.rs:308
↓ 201 callers
Function
with_default
(dispatcher: &Dispatch, f: impl FnOnce() -> T)
tracing-core/src/dispatcher.rs:254
↓ 146 callers
Method
named
Sets a name to expect when matching a span. If an event is recorded with a name that differs from the one provided to this method, the expectation wi
tracing-mock/src/span.rs:294
↓ 138 callers
Method
with
(f: impl FnOnce(Attributes<'_>) -> T)
tracing-subscriber/src/field/mod.rs:254
↓ 137 callers
Function
span
Construct a new [`ExpectedSpan`]. For details on how to add additional assertions to the expected span, see the [`span`] module and the [`ExpectedSpa
tracing-mock/src/expect.rs:133
↓ 106 callers
Method
enter
Adds an expectation that entering a span matching the [`ExpectedSpan`] will be recorded next. This expectation is generally accompanied by a call to
tracing-mock/src/layer.rs:557
↓ 101 callers
Method
with_fields
Adds fields to expect when matching a span. Note**: This method returns a [`NewSpan`] and as such, this expectation can only be validated when expect
tracing-mock/src/span.rs:776
↓ 99 callers
Method
clone
(&self)
tracing-core/src/field.rs:854
↓ 94 callers
Function
field
Construct a new [`ExpectedField`]. For details on how to set the value of the expected field and how to expect multiple fields, see the [`field`] mod
tracing-mock/src/expect.rs:184
↓ 93 callers
Method
at_level
Sets the [`Level`](tracing::Level) to expect when matching a span. If an span is record with a level that differs from the one provided to this metho
tracing-mock/src/span.rs:475
↓ 87 callers
Method
with_value
Sets the value to expect when matching this field. If the recorded value for this field is different, the expectation will fail. # Examples ``` use
tracing-mock/src/field.rs:196
↓ 85 callers
Method
new_span
Adds an expectation that the creation of a span will be recorded next. This function accepts `Into<NewSpan>` instead of [`ExpectedSpan`] directly. [`
tracing-mock/src/layer.rs:478
↓ 83 callers
Method
lock
(&self)
tracing-core/src/sync.rs:20
↓ 80 callers
Function
with_default
(subscriber: S, f: impl FnOnce() -> T)
tracing/src/subscriber.rs:20
↓ 77 callers
Method
drop_span
(&self, id: span::Id)
tracing-core/src/dispatcher.rs:679
↓ 71 callers
Method
with_filter
(self, filter: FilterId)
tracing-subscriber/src/layer/context.rs:371
↓ 67 callers
Method
exit
Adds an expectation that exiting a span matching the [`ExpectedSpan`] will be recorded next. As a span may be entered and exited multiple times, this
tracing-mock/src/layer.rs:637
↓ 61 callers
Function
event
()
tracing-subscriber/tests/reload.rs:11
↓ 61 callers
Method
set_default
(self)
tracing-subscriber/src/util.rs:41
↓ 60 callers
Method
event
(&self, _: &Event<'_>)
tracing-subscriber/tests/reload.rs:30
↓ 59 callers
Method
with_ancestry
Configures this `ExpectedSpan` to expect the specified [`ExpectedAncestry`]. A span's ancestry indicates whether it has a parent or is a root span and
tracing-mock/src/span.rs:707
↓ 53 callers
Function
event
Create a new [`ExpectedEvent`]. For details on how to add additional assertions to the expected event, see the [`event`] module and the [`ExpectedEve
tracing-mock/src/expect.rs:87
↓ 53 callers
Method
event
Adds an expectation that an event matching the [`ExpectedEvent`] will be recorded next. The `event` can be a default mock which will match any event
tracing-mock/src/layer.rs:409
↓ 50 callers
Function
fmt
()
tracing-subscriber/src/fmt/mod.rs:324
↓ 43 callers
Function
span
()
tracing/tests/macros.rs:31
↓ 41 callers
Method
clone
(&self)
tracing-subscriber/src/filter/env/mod.rs:214
↓ 41 callers
Method
with_writer
Sets the [`MakeWriter`] that the subscriber being built will use to write events. # Examples Using `stderr` rather than `stdout`: ```rust use traci
tracing-subscriber/src/fmt/mod.rs:1057
↓ 40 callers
Method
and_then
Composes this layer around the given `Layer`, returning a `Layered` struct implementing `Layer`. The returned `Layer` will call the methods on this `
tracing-subscriber/src/layer/mod.rs:1040
↓ 40 callers
Method
finish
Finish the builder, returning a new `FmtSubscriber`.
tracing-subscriber/src/fmt/mod.rs:486
↓ 38 callers
Method
and
Adds an additional [`ExpectedField`] to be matched. Any fields introduced by `.and` must also match. If any fields are not present, or if the value f
tracing-mock/src/field.rs:255
↓ 38 callers
Method
name
(&self)
tracing-mock/src/span.rs:791
↓ 37 callers
Method
as_ref
(&self)
tracing-core/src/field.rs:830
↓ 36 callers
Method
in_scope
Executes the given function in the context of this span. If this span is enabled, then this function enters the span, invokes `f` and then exits the
tracing/src/span.rs:1114
↓ 36 callers
Method
target
(&self)
tracing-mock/src/span.rs:799
↓ 35 callers
Method
as_ref
(&self)
tracing-subscriber/src/filter/env/field.rs:306
↓ 35 callers
Method
get
Immutably borrows a type previously inserted into this `Extensions`.
tracing-subscriber/src/registry/extensions.rs:50
↓ 35 callers
Method
parse
(s: &str, regex: bool)
tracing-subscriber/src/filter/env/field.rs:163
↓ 34 callers
Method
entered
(self)
tracing/src/span.rs:910
↓ 34 callers
Method
iter
(&self)
tracing-core/src/field.rs:914
↓ 33 callers
Method
field
Returns the [`Field`] named `name`, or `None` if no such field exists. [`Field`]: super::Field
tracing-core/src/field.rs:886
↓ 32 callers
Function
event
()
tracing/tests/macros.rs:454
↓ 32 callers
Method
event
(&self, event: &Event<'_>)
tracing/tests/subscriber.rs:43
↓ 30 callers
Method
clone
(&self)
tracing-subscriber/src/reload.rs:354
↓ 29 callers
Method
new_span
(&self, _: &Attributes<'_>)
tracing/tests/subscriber.rs:35
↓ 28 callers
Method
level
(&self)
tracing-mock/src/span.rs:795
↓ 28 callers
Function
named
(name: impl std::fmt::Display)
tracing-mock/src/layer.rs:248
↓ 28 callers
Method
with_subscriber
Composes this `Layer` with the given [`Subscriber`], returning a `Layered` struct that implements [`Subscriber`]. The returned `Layered` subscriber w
tracing-subscriber/src/layer/mod.rs:1092
↓ 27 callers
Method
enter
(&self, _: &Id)
tracing/tests/subscriber.rs:48
↓ 27 callers
Method
push
(&mut self, id: Id)
tracing-subscriber/src/registry/stack.rs:21
↓ 26 callers
Method
exit
(&self, _: &Id)
tracing/tests/subscriber.rs:50
↓ 25 callers
Method
with_target
Sets whether or not an event's target is displayed.
tracing-subscriber/src/fmt/mod.rs:678
↓ 24 callers
Method
insert
Insert a type into this `Extensions`. Note that extensions are _not_ `Layer`-specific—they are _span_-specific. This means that other layers can acce
tracing-subscriber/src/registry/extensions.rs:87
↓ 23 callers
Method
len
Returns the number of fields that would be visited from this `Record` when [`Record::record()`] is called [`Record::record()`]: Record::record()
tracing-core/src/span.rs:234
↓ 22 callers
Function
get_default
(mut f: F)
tracing-core/src/dispatcher.rs:379
↓ 22 callers
Method
in_scope
(self, spans: impl IntoIterator<Item = span::ExpectedSpan>)
tracing-mock/src/event.rs:520
↓ 22 callers
Method
init
()
tracing-log/src/log_tracer.rs:150
↓ 21 callers
Method
clone
(&self)
tracing/src/span.rs:1544
↓ 21 callers
Method
fields
Returns the set of all [fields] defined by this span's [`Metadata`]. Note that the [`FieldSet`] returned by this method includes *all* the fields dec
tracing-core/src/span.rs:210
↓ 21 callers
Method
with_max_level
Sets a global maximum level for `log` records. Log records whose level is more verbose than the provided level will be disabled. By default, all `lo
tracing-log/src/log_tracer.rs:221
↓ 20 callers
Method
callsite
(&self)
tracing-core/src/field.rs:808
↓ 20 callers
Method
clone
(&self)
tracing-subscriber/src/layer/context.rs:424
↓ 20 callers
Function
display
Wraps a type implementing `fmt::Display` as a `Value` that can be recorded using its `Display` implementation.
tracing-core/src/field.rs:368
↓ 20 callers
Method
finish
Completes serializing the visited object, returning `Ok(())` if all fields were serialized correctly, or `Error(S::Error)` if a field could not be ser
tracing-serde/src/lib.rs:378
↓ 20 callers
Function
has_explicit_parent
Convenience function that returns [`ExpectedAncestry::HasExplicitParent`] with provided name.
tracing-mock/src/expect.rs:284
↓ 20 callers
Method
iter
(&self)
tracing-subscriber/src/registry/stack.rs:42
↓ 20 callers
Method
level
(&self)
tracing-subscriber/src/filter/directive.rs:267
↓ 18 callers
Method
enter
(&self, id: &span::Id)
tracing-subscriber/src/fmt/mod.rs:415
↓ 18 callers
Function
has_contextual_parent
Convenience function that returns [`ExpectedAncestry::HasContextualParent`] with provided name.
tracing-mock/src/expect.rs:273
↓ 18 callers
Method
iter
Returns an iterator over the [target]-[`LevelFilter`] pairs in this filter. The order of iteration is undefined. # Examples ``` use tracing_subscri
tracing-subscriber/src/filter/targets.rs:360
↓ 18 callers
Method
name
TODO: reference count these strings?
tracing-subscriber/src/filter/env/field.rs:159
↓ 18 callers
Function
parse_directives
(dirs: impl AsRef<str>)
tracing-subscriber/src/filter/env/directive.rs:487
↓ 17 callers
Function
never
Creates a non-rolling file appender. The appender returned by `rolling::never` can be used with `non_blocking` to create a non-blocking, non-rotating
tracing-appender/src/rolling.rs:440
↓ 17 callers
Function
set_default
(dispatcher: &Dispatch)
tracing-core/src/dispatcher.rs:276
↓ 17 callers
Method
with_target
Sets the target to expect when matching a span. If an event is recorded with a target that doesn't match the provided target, this expectation will f
tracing-mock/src/span.rs:529
↓ 16 callers
Method
file
Returns the name of the source code file where the span occurred, or `None` if the file is unknown
tracing-core/src/metadata.rs:307
↓ 16 callers
Method
is_empty
(&self)
tracing-subscriber/src/filter/directive.rs:53
↓ 16 callers
Method
line
Returns the line number in the source code file where the span occurred, or `None` if the line number is unknown.
tracing-core/src/metadata.rs:313
↓ 16 callers
Method
subscriber
(&self)
tracing-core/src/dispatcher.rs:509
↓ 16 callers
Method
value_set
(&'v self, values: &'v V)
tracing-core/src/field.rs:927
↓ 15 callers
Function
block_on_future
(future: F)
tracing-test/src/lib.rs:52
↓ 15 callers
Method
build
Builds a new [`RollingFileAppender`] with the configured parameters, emitting log files to the provided directory. Unlike [`RollingFileAppender::new`
tracing-appender/src/rolling/builder.rs:298
↓ 15 callers
Function
debug
()
tracing-attributes/tests/levels.rs:12
↓ 15 callers
Method
enter
(&self, _: &Id)
tracing-subscriber/tests/reload.rs:31
↓ 15 callers
Method
instrument
Instruments this type with the provided [`Span`], returning an [`Instrumented`] wrapper. If the instrumented type is a future, stream, or sink, the a
tracing-futures/src/lib.rs:155
↓ 14 callers
Method
exit
(&self, _: &Id)
tracing-subscriber/tests/reload.rs:32
↓ 14 callers
Method
filter_map
(&self)
tracing-subscriber/src/filter/layer_filters/mod.rs:1247
↓ 14 callers
Function
msg
Construct a new message [`ExpectedField`]. For details on how to set the value of the message field and how to expect multiple fields, see the [`fiel
tracing-mock/src/expect.rs:240
↓ 14 callers
Method
or_else
Combines `self` with another type implementing [`MakeWriter`], returning a new [`MakeWriter`] that calls `other`'s [`make_writer`] if `self`'s `make_w
tracing-subscriber/src/fmt/writer.rs:486
↓ 14 callers
Function
run_test
(span: NewSpan, fun: F)
tracing-attributes/tests/fields.rs:239
↓ 14 callers
Function
shave_all
(yaks: usize)
examples/examples/fmt/yak_shave.rs:30
↓ 14 callers
Method
span
Borrows the `Span` that this type is instrumented by.
tracing-futures/src/lib.rs:453
↓ 14 callers
Method
with_env_filter
( self, filter: impl Into<crate::EnvFilter>, )
tracing-subscriber/src/fmt/mod.rs:957
↓ 14 callers
Method
without_time
Do not emit timestamps with log messages.
tracing-subscriber/src/fmt/mod.rs:563
↓ 13 callers
Function
debug
()
tracing/tests/macros.rs:665
↓ 13 callers
Method
get_string
(&self)
tracing-subscriber/src/fmt/mod.rs:1333
↓ 13 callers
Method
into_iter
(self)
tracing-core/src/field.rs:979
↓ 13 callers
Method
is_none
(&self)
tracing/src/span.rs:1273
next →
1–100 of 2,480, ranked by callers