File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
#![ deny( rust_2018_idioms) ]
2
2
use tracing:: { error, info} ;
3
+ use tracing_journald:: { Priority , PriorityMappings } ;
3
4
use tracing_subscriber:: prelude:: * ;
4
5
5
6
#[ path = "fmt/yak_shave.rs" ]
@@ -10,7 +11,17 @@ fn main() {
10
11
. with ( tracing_subscriber:: fmt:: subscriber ( ) . with_target ( false ) ) ;
11
12
match tracing_journald:: subscriber ( ) {
12
13
Ok ( subscriber) => {
13
- registry. with ( subscriber) . init ( ) ;
14
+ registry
15
+ . with (
16
+ subscriber
17
+ // We can tweak the mappings between the trace level and
18
+ // the journal priorities.
19
+ . with_priority_mappings ( PriorityMappings {
20
+ info : Priority :: Informational ,
21
+ ..PriorityMappings :: new ( )
22
+ } ) ,
23
+ )
24
+ . init ( ) ;
14
25
}
15
26
// journald is typically available on Linux systems, but nowhere else. Portable software
16
27
// should handle its absence gracefully.
You can’t perform that action at this time.
0 commit comments