File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed
Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,10 @@ impl Build for FileLoggerBuilder {
154154 }
155155 #[ cfg( feature = "json" ) ]
156156 Format :: Json => {
157- let drain = slog_json:: Json :: default ( self . appender . clone ( ) ) ;
157+ let drain = slog_json:: Json :: new ( self . appender . clone ( ) )
158+ . set_flush ( true )
159+ . add_default_keys ( )
160+ . build ( ) ;
158161 self . common . build_with_drain ( drain)
159162 }
160163 } ;
Original file line number Diff line number Diff line change @@ -103,12 +103,18 @@ impl Build for TerminalLoggerBuilder {
103103 }
104104 #[ cfg( feature = "json" ) ]
105105 Format :: Json => match self . destination {
106- Destination :: Stdout => self
107- . common
108- . build_with_drain ( slog_json:: Json :: default ( std:: io:: stdout ( ) ) ) ,
109- Destination :: Stderr => self
110- . common
111- . build_with_drain ( slog_json:: Json :: default ( std:: io:: stderr ( ) ) ) ,
106+ Destination :: Stdout => self . common . build_with_drain (
107+ slog_json:: Json :: new ( std:: io:: stdout ( ) )
108+ . set_flush ( true )
109+ . add_default_keys ( )
110+ . build ( ) ,
111+ ) ,
112+ Destination :: Stderr => self . common . build_with_drain (
113+ slog_json:: Json :: new ( std:: io:: stderr ( ) )
114+ . set_flush ( true )
115+ . add_default_keys ( )
116+ . build ( ) ,
117+ ) ,
112118 } ,
113119 } ;
114120 Ok ( logger)
You can’t perform that action at this time.
0 commit comments