Added Rolling Application Log Files - #16
Open
seanpar203 wants to merge 1 commit into
Open
Conversation
The workshop desktop app lacked persistent logging for diagnostics and panic backtraces. `crates/workshop/src/logging.rs` introduces `init_logging`, configuring a `tracing_subscriber` with daily rolling files via `tracing-appender` alongside stderr output, and installs a custom panic hook. `main` in `crates/workshop/src/main.rs` initializes the subscriber and replaces ad-hoc `eprintln!` calls with structured `tracing` events. - `resolve_log_dir` places log files under platform per-user directories and allows an override through `PROMPTFORGE_LOG_DIR`. - `install_panic_hook` captures unhandled panics and backtraces through `tracing::error!` before invoking the previous panic hook. - Existing test suites are unchanged; new unit tests in `crates/workshop/src/logging.rs` verify directory resolution paths and fallbacks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Essentially this PR introduces capturing logging that's happening in different parts of the application and storing logs in the idiomatic place PER platform:
• macOS:
~/Library/Logs/PromptForge/• Windows:
%LOCALAPPDATA%\PromptForge\logs\• Linux / BSD:
${XDG_STATE_HOME:-~/.local/state}/promptforge/logs/And supports an overridable custom location by setting the
PROMPTFORGE_LOG_DIRenv variable.