This PR adds a file-based logging system with size-based rotation to the desktop application. It essentially redirects existing diagnostic to size-based rotating files for troubleshooting environment-specific issues. Closes HFE-801 The desktop application currently lacks a persistent logging mechanism in production environments. Logs are only available through the development mode console. This PR will help diagnose issues reported in #4859, #4950, #5003, discussions #4984 and #4986. Mainly aiming to understand errors in specific environments that can't be reproduced in our testing setups. This implementation uses the tracing ecosystem (`tracing`, `tracing_subscriber`, `tracing_appender`) along with `file_rotate` to create log files in the platform's log directory. The logs are automatically rotated when they reach `10MB`, with a maximum of `5` files retained. Thinking 10 * 5 MB is reasonable disk usage while maintaining sufficient history. The system currently writes to both the console (with ANSI colors where supported) and to files (without ANSI formatting for readability). Log levels are currently controlled via the `RUST_LOG` environment variable, defaulting to "debug" when not specified. | OS | Log File Path | |---------|------------------------------------------------------| | Windows | `C:\Users\<username>\AppData\Local\io.hoppscotch.desktop\logs\io.hoppscotch.desktop.log` | | macOS | `~/Library/Logs/io.hoppscotch.desktop/io.hoppscotch.desktop.log` | | Linux | `~/.local/share/io.hoppscotch.desktop/logs/io.hoppscotch.desktop.log` |
43 lines
1.6 KiB
TOML
43 lines
1.6 KiB
TOML
[package]
|
|
name = "hoppscotch-desktop"
|
|
version = "25.3.2"
|
|
description = "Desktop App for hoppscotch.io"
|
|
authors = ["CuriousCorrelation"]
|
|
edition = "2021"
|
|
|
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
|
|
[lib]
|
|
# The `_lib` suffix may seem redundant but it is necessary
|
|
# to make the lib name unique and wouldn't conflict with the bin name.
|
|
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
|
|
name = "hoppscotch_desktop_lib"
|
|
crate-type = ["staticlib", "cdylib", "rlib"]
|
|
|
|
[build-dependencies]
|
|
tauri-build = { version = "2", features = [] }
|
|
|
|
[dependencies]
|
|
tauri = { version = "2", features = ["devtools"] }
|
|
tauri-plugin-shell = { version = "2", features = [] }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = { version = "1", features = [] }
|
|
tracing = "0.1.41"
|
|
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
|
|
tracing-appender = { version = "0.2.3" }
|
|
tauri-plugin-store = "2.2.0"
|
|
tauri-plugin-dialog = "2.2.0"
|
|
tauri-plugin-fs = "2.2.0"
|
|
tauri-plugin-deep-link = "2.2.0"
|
|
tauri-plugin-appload = { git = "https://github.com/CuriousCorrelation/tauri-plugin-appload" }
|
|
tauri-plugin-relay = { git = "https://github.com/CuriousCorrelation/tauri-plugin-relay" }
|
|
axum = "0.8.1"
|
|
tower-http = { version = "0.6.2", features = ["cors"] }
|
|
portpicker = "0.1.1"
|
|
tokio = "1.43.0"
|
|
tauri-plugin-process = "2.2.0"
|
|
file-rotate = "0.8.0"
|
|
|
|
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
|
|
tauri-plugin-updater = "2.3.1"
|
|
tauri-plugin-window-state = "2.2.1"
|