Skip to content

Commit e947ca7

Browse files
committed
Print errors regardless of logging filters
Before: ```console $ RUST_LOG=foobar xh ssh://example.org [no output] ``` After: ```console $ RUST_LOG=foobar xh ssh://example.org xh: error: builder error for url (ssh://example.org) Caused by: URL scheme is not allowed ``` Reusing the `log` formatter for this was cute but ultimately confusing.
1 parent 2b98447 commit e947ca7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,15 @@ fn main() {
7373
log::debug!("{args:#?}");
7474

7575
let native_tls = args.native_tls;
76+
let bin_name = args.bin_name.clone();
7677

7778
match run(args) {
7879
Ok(exit_code) => {
7980
process::exit(exit_code);
8081
}
8182
Err(err) => {
8283
log::debug!("{err:#?}");
83-
log::error!("{err:?}");
84+
eprintln!("{bin_name}: error: {err:?}");
8485
let msg = err.root_cause().to_string();
8586
if native_tls && msg == "invalid minimum TLS version for backend" {
8687
eprintln!();

0 commit comments

Comments
 (0)