mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-09-11 12:25:42 +03:00
feat: update logging configuration to use LOG_LEVEL
environment variable instead of debug
feature flag
This commit is contained in:
parent
6abf22089b
commit
383d5a3bb5
@ -21,10 +21,10 @@ Now you should be able to run the app in development mode:
|
||||
$ pnpm tauri dev
|
||||
```
|
||||
|
||||
By default it will not print debug logs to console. If you want debug logs, use `debug` feature:
|
||||
By default it will not print debug logs to console. If you want debug logs, set `LOG_LEVEL` environment variable:
|
||||
|
||||
```bash
|
||||
$ pnpm tauri dev --features debug
|
||||
$ LOG_LEVEL=debug pnpm tauri dev
|
||||
```
|
||||
|
||||
### Lint & format
|
||||
|
@ -78,8 +78,6 @@ zip = "0.6.5"
|
||||
# by default Tauri runs in production mode
|
||||
# when `tauri dev` runs it is executed with `cargo run --no-default-features` if `devPath` is an URL
|
||||
default = ["custom-protocol"]
|
||||
# enabled debug logging
|
||||
debug = []
|
||||
# this feature enables devtools
|
||||
devtools = ["tauri/devtools"]
|
||||
# this feature is used used for production builds where `devPath` points to the filesystem
|
||||
|
@ -22,11 +22,11 @@ pub fn init(app_handle: &AppHandle) {
|
||||
.with_target(false)
|
||||
.compact();
|
||||
|
||||
let log_level_filter = if cfg!(feature = "debug") {
|
||||
LevelFilter::DEBUG
|
||||
} else {
|
||||
LevelFilter::INFO
|
||||
};
|
||||
let log_level_filter = std::env::var("LOG_LEVEL")
|
||||
.unwrap_or("info".to_string())
|
||||
.to_lowercase()
|
||||
.parse()
|
||||
.unwrap_or(LevelFilter::INFO);
|
||||
|
||||
let subscriber = tracing_subscriber::registry()
|
||||
.with(
|
||||
|
Loading…
Reference in New Issue
Block a user