mirror of
https://github.com/denisidoro/navi
synced 2024-11-21 19:13:07 +00:00
eprintln init_logger failure (may need redir if it's flushed away)
and add a description on logging
This commit is contained in:
parent
8a2bf7d1eb
commit
0fe4bc2447
2 changed files with 11 additions and 2 deletions
|
@ -29,3 +29,9 @@ Run the following command to generate a config file with the default parameters:
|
|||
```sh
|
||||
navi info config-example > "$(navi info config-path)"
|
||||
```
|
||||
|
||||
### Logging
|
||||
|
||||
The log file will be created under the same directory where the config locates.
|
||||
|
||||
And you can use the `RUST_LOG` env to set the log level, e.g. `RUST_LOG=debug navi`.
|
||||
|
|
|
@ -24,8 +24,11 @@ impl FileAnIssue {
|
|||
}
|
||||
}
|
||||
|
||||
fn main() -> Result<(), anyhow::Error> {
|
||||
init_logger()?;
|
||||
fn main() -> anyhow::Result<()> {
|
||||
if let Err(err) = init_logger() {
|
||||
// may need redir stderr to a file to show this log initialization error
|
||||
eprintln!("failed to initialize logging: {err:?}");
|
||||
}
|
||||
navi::handle().map_err(|e| {
|
||||
error!("{e:?}");
|
||||
FileAnIssue::new(e).into()
|
||||
|
|
Loading…
Reference in a new issue