@@ -1288,12 +1288,19 @@ pub fn init_env_logger(env: &str) {
1288
1288
"always" => true ,
1289
1289
"never" => false ,
1290
1290
"auto" => stdout_isatty ( ) ,
1291
- _ => panic ! ( "invalid log color value '{}': expected one of always, never, or auto" , value) ,
1291
+ _ => early_error (
1292
+ ErrorOutputType :: default ( ) ,
1293
+ & format ! (
1294
+ "invalid log color value '{}': expected one of always, never, or auto" ,
1295
+ value
1296
+ ) ,
1297
+ ) ,
1292
1298
} ,
1293
1299
Err ( std:: env:: VarError :: NotPresent ) => stdout_isatty ( ) ,
1294
- Err ( std:: env:: VarError :: NotUnicode ( _value) ) => {
1295
- panic ! ( "non-unicode log color value: expected one of always, never, or auto" )
1296
- }
1300
+ Err ( std:: env:: VarError :: NotUnicode ( _value) ) => early_error (
1301
+ ErrorOutputType :: default ( ) ,
1302
+ "non-Unicode log color value: expected one of always, never, or auto" ,
1303
+ ) ,
1297
1304
} ;
1298
1305
let filter = tracing_subscriber:: EnvFilter :: from_env ( env) ;
1299
1306
let layer = tracing_tree:: HierarchicalLayer :: default ( )
@@ -1324,7 +1331,7 @@ pub fn main() -> ! {
1324
1331
arg. into_string ( ) . unwrap_or_else ( |arg| {
1325
1332
early_error (
1326
1333
ErrorOutputType :: default ( ) ,
1327
- & format ! ( "Argument {} is not valid Unicode: {:?}" , i, arg) ,
1334
+ & format ! ( "argument {} is not valid Unicode: {:?}" , i, arg) ,
1328
1335
)
1329
1336
} )
1330
1337
} )
0 commit comments