File tree 2 files changed +14
-6
lines changed 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ ena = "0.14.0"
14
14
itertools = " 0.9.0"
15
15
petgraph = " 0.5.0"
16
16
tracing = " 0.1"
17
- tracing-subscriber = " 0.2"
18
- tracing-tree = " 0.1.1"
17
+ tracing-subscriber = { version = " 0.2" , optional = true }
18
+ tracing-tree = { version = " 0.1.1" , optional = true }
19
19
rustc-hash = { version = " 1.0.0" }
20
20
21
21
chalk-derive = { version = " 0.16.0-dev.0" , path = " ../chalk-derive" }
@@ -26,7 +26,8 @@ chalk-ir = { version = "0.16.0-dev.0", path = "../chalk-ir" }
26
26
chalk-integration = { path = " ../chalk-integration" }
27
27
28
28
[features ]
29
- default = [" slg-solver" , " recursive-solver" ]
29
+ default = [" slg-solver" , " recursive-solver" , " tracing-full " ]
30
30
31
31
slg-solver = [" chalk-engine" ]
32
32
recursive-solver = []
33
+ tracing-full = [" tracing-subscriber" , " tracing-tree" ]
Original file line number Diff line number Diff line change 1
- use tracing_subscriber:: { layer:: SubscriberExt , EnvFilter , Registry } ;
2
- use tracing_tree:: HierarchicalLayer ;
3
-
4
1
/// Run an action with a tracing log subscriber. The logging level is loaded
5
2
/// from `CHALK_DEBUG`.
3
+ #[ cfg( feature = "tracing-full" ) ]
6
4
pub fn with_tracing_logs < T > ( action : impl FnOnce ( ) -> T ) -> T {
5
+ use tracing_subscriber:: { layer:: SubscriberExt , EnvFilter , Registry } ;
6
+ use tracing_tree:: HierarchicalLayer ;
7
7
let filter = EnvFilter :: from_env ( "CHALK_DEBUG" ) ;
8
8
let subscriber = Registry :: default ( )
9
9
. with ( filter)
10
10
. with ( HierarchicalLayer :: new ( 2 ) ) ;
11
11
tracing:: subscriber:: with_default ( subscriber, action)
12
12
}
13
+
14
+ /// Run an action with a tracing log subscriber. The logging level is loaded
15
+ /// from `CHALK_DEBUG`.
16
+ #[ cfg( not( feature = "tracing-full" ) ) ]
17
+ pub fn with_tracing_logs < T > ( action : impl FnOnce ( ) -> T ) -> T {
18
+ action ( )
19
+ }
You can’t perform that action at this time.
0 commit comments