File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -221,17 +221,24 @@ fn make_logger() -> Logger {
221
221
} else {
222
222
let debug = env:: var ( "STACKS_LOG_DEBUG" ) == Ok ( "1" . into ( ) ) ;
223
223
let pretty_print = env:: var ( "STACKS_LOG_PP" ) == Ok ( "1" . into ( ) ) ;
224
- #[ cfg( not( any( test, feature = "testing" ) ) ) ]
225
- let decorator = slog_term:: PlainSyncDecorator :: new ( std:: io:: stderr ( ) ) ;
226
- #[ cfg( any( test, feature = "testing" ) ) ]
227
- let decorator = slog_term:: PlainSyncDecorator :: new ( slog_term:: TestStdoutWriter ) ;
224
+ let decorator = get_decorator ( ) ;
228
225
let atty = isatty ( Stream :: Stderr ) ;
229
226
let drain = TermFormat :: new ( decorator, pretty_print, debug, atty) ;
230
227
let logger = Logger :: root ( drain. ignore_res ( ) , o ! ( ) ) ;
231
228
logger
232
229
}
233
230
}
234
231
232
+ #[ cfg( any( test, feature = "testing" ) ) ]
233
+ fn get_decorator ( ) -> slog_term:: PlainSyncDecorator < slog_term:: TestStdoutWriter > {
234
+ slog_term:: PlainSyncDecorator :: new ( slog_term:: TestStdoutWriter )
235
+ }
236
+
237
+ #[ cfg( not( any( test, feature = "testing" ) ) ) ]
238
+ fn get_decorator ( ) -> slog_term:: PlainSyncDecorator < std:: io:: Stderr > {
239
+ slog_term:: PlainSyncDecorator :: new ( std:: io:: stderr ( ) )
240
+ }
241
+
235
242
fn inner_get_loglevel ( ) -> slog:: Level {
236
243
if env:: var ( "STACKS_LOG_TRACE" ) == Ok ( "1" . into ( ) ) {
237
244
slog:: Level :: Trace
You can’t perform that action at this time.
0 commit comments