refactor: enhance logging system and add new development commands (#4803)

* refactor: enhance logging system and add new development commands

* refactor: add cfg-if dependency and improve logging configuration
This commit is contained in:
Tunglies
2025-09-20 00:04:46 +08:00
committed by GitHub
parent e869da8d4c
commit 7811714f89
9 changed files with 170 additions and 197 deletions

View File

@@ -77,7 +77,9 @@ mod app_init {
.plugin(tauri_plugin_deep_link::init())
.plugin(tauri_plugin_http::init());
#[cfg(all(debug_assertions, not(feature = "tokio-trace")))]
// Devtools plugin only in debug mode with feature tauri-dev
// to avoid duplicated registering of logger since the devtools plugin also registers a logger
#[cfg(all(debug_assertions, not(feature = "tokio-trace"), feature = "tauri-dev"))]
{
builder = builder.plugin(tauri_plugin_devtools::init());
}
@@ -271,8 +273,7 @@ pub fn run() {
// Setup singleton check
app_init::init_singleton_check();
// We don't need init_portable_flag here anymore due to the init_config will do the things
// let _ = utils::dirs::init_portable_flag();
let _ = utils::dirs::init_portable_flag();
// Set Linux environment variable
#[cfg(target_os = "linux")]