@@ -35,11 +35,11 @@ Tokio project, but does _not_ require the `tokio` runtime to be used.
3535
3636### In Applications
3737
38- In order to record trace events, executables have to use a ` Subscriber `
39- implementation compatible with ` tracing ` . A ` Subscriber ` implements a way of
38+ In order to record trace events, executables have to use a collector
39+ implementation compatible with ` tracing ` . A collector implements a way of
4040collecting trace data, such as by logging it to standard output.
4141[ ` tracing-subscriber ` ] [ tracing-subscriber-docs ] 's [ ` fmt ` module] [ fmt ] provides
42- a subscriber for logging traces with reasonable defaults. Additionally,
42+ a collector for logging traces with reasonable defaults. Additionally,
4343` tracing-subscriber ` is able to consume messages emitted by ` log ` -instrumented
4444libraries and modules.
4545
@@ -51,14 +51,14 @@ tracing = "0.1"
5151tracing-subscriber = " 0.2"
5252```
5353
54- Then create and install a ` Subscriber ` , for example using [ ` init() ` ] :
54+ Then create and install a collector , for example using [ ` init() ` ] :
5555
5656``` rust
5757use tracing :: info;
5858use tracing_subscriber;
5959
6060fn main () {
61- // install global subscriber configured based on RUST_LOG envvar .
61+ // install global collector configured based on RUST_LOG env var .
6262 tracing_subscriber :: fmt :: init ();
6363
6464 let number_of_yaks = 3 ;
@@ -73,7 +73,7 @@ fn main() {
7373}
7474```
7575
76- Using ` init() ` calls [ ` set_global_default() ` ] so this subscriber will be used
76+ Using ` init() ` calls [ ` set_global_default() ` ] so this collector will be used
7777as the default in all threads for the remainder of the duration of the
7878program, similar to how loggers work in the ` log ` crate.
7979
@@ -82,34 +82,34 @@ program, similar to how loggers work in the `log` crate.
8282[ `set_global_default` ] : https://docs.rs/tracing/latest/tracing/subscriber/fn.set_global_default.html
8383
8484
85- For more control, a subscriber can be built in stages and not set globally,
86- but instead used to locally override the default subscriber . For example:
85+ For more control, a collector can be built in stages and not set globally,
86+ but instead used to locally override the default collector . For example:
8787
8888``` rust
8989use tracing :: {info, Level };
9090use tracing_subscriber;
9191
9292fn main () {
93- let subscriber = tracing_subscriber :: fmt ()
93+ let collector = tracing_subscriber :: fmt ()
9494 // filter spans/events with level TRACE or higher.
9595 . with_max_level (Level :: TRACE )
9696 // build but do not install the subscriber.
9797 . finish ();
9898
99- tracing :: subscriber :: with_default (subscriber , || {
99+ tracing :: collector :: with_default (collector , || {
100100 info! (" This will be logged to stdout" );
101101 });
102102 info! (" This will _not_ be logged to stdout" );
103103}
104104```
105105
106- Any trace events generated outside the context of a subscriber will not be collected.
106+ Any trace events generated outside the context of a collector will not be collected.
107107
108- This approach allows trace data to be collected by multiple subscribers
108+ This approach allows trace data to be collected by multiple collectors
109109within different contexts in the program. Note that the override only applies to the
110110currently executing thread; other threads will not see the change from with_default.
111111
112- Once a subscriber has been set, instrumentation points may be added to the
112+ Once a collector has been set, instrumentation points may be added to the
113113executable using the ` tracing ` crate's macros.
114114
115115[ `tracing-subscriber` ] : https://docs.rs/tracing-subscriber/
@@ -186,7 +186,7 @@ pub fn shave_all(yaks: usize) -> usize {
186186tracing = " 0.1"
187187```
188188
189- Note: Libraries should * NOT* install a subscriber by using a method that calls
189+ Note: Libraries should * NOT* install a collector by using a method that calls
190190[ ` set_global_default() ` ] , as this will cause conflicts when executables try to
191191set the default later.
192192
@@ -317,8 +317,8 @@ The crates included as part of Tracing are:
317317* [ ` tracing-serde ` ] : A compatibility layer for serializing trace data with
318318 ` serde ` (unstable).
319319
320- * [ ` tracing-subscriber ` ] : Subscriber implementations, and utilities for
321- implementing and composing ` Subscriber ` s.
320+ * [ ` tracing-subscriber ` ] : Collector implementations, and utilities for
321+ implementing and composing ` Collector ` s.
322322 ([ crates.io] [ sub-crates ] |[ docs] [ sub-docs ] )
323323
324324* [ ` tracing-tower ` ] : Compatibility with the ` tower ` ecosystem (unstable).
@@ -391,11 +391,11 @@ are not maintained by the `tokio` project. These include:
391391 pretty printing them.
392392- [ ` spandoc ` ] provides a proc macro for constructing spans from doc comments
393393 _ inside_ of functions.
394- - [ ` tracing-wasm ` ] provides a ` Subscriber ` /` Layer ` implementation that reports
394+ - [ ` tracing-wasm ` ] provides a ` Collector ` /` Subscriber ` implementation that reports
395395 events and spans via browser ` console.log ` and [ User Timing API (` window.performance ` )] .
396396- [ ` test-env-log ` ] takes care of initializing ` tracing ` for tests, based on
397397 environment variables with an ` env_logger ` compatible syntax.
398- - [ ` tracing-unwrap ` ] provides convenience methods to report failed unwraps on ` Result ` or ` Option ` types to a ` Subscriber ` .
398+ - [ ` tracing-unwrap ` ] provides convenience methods to report failed unwraps on ` Result ` or ` Option ` types to a ` Collector ` .
399399- [ ` diesel-tracing ` ] provides integration with [ ` diesel ` ] database connections.
400400- [ ` tracing-tracy ` ] provides a way to collect [ Tracy] profiles in instrumented
401401 applications.
0 commit comments