File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11#![ deny( rust_2018_idioms) ]
22use tracing:: { error, info} ;
3+ use tracing_journald:: { Priority , PriorityMappings } ;
34use tracing_subscriber:: prelude:: * ;
45
56#[ path = "fmt/yak_shave.rs" ]
@@ -10,7 +11,17 @@ fn main() {
1011 . with ( tracing_subscriber:: fmt:: subscriber ( ) . with_target ( false ) ) ;
1112 match tracing_journald:: subscriber ( ) {
1213 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 ( ) ;
1425 }
1526 // journald is typically available on Linux systems, but nowhere else. Portable software
1627 // should handle its absence gracefully.
You can’t perform that action at this time.
0 commit comments