-
-
Notifications
You must be signed in to change notification settings - Fork 4
Setup server logging to file using standard XDG directory #334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup server logging to file using standard XDG directory #334
Conversation
- Added directories dependency to djls-server - Updated init_tracing to use XDG cache dir with /tmp fallback - Added tests to verify log directory logic - Updated documentation to reflect new log location Co-authored-by: joshuadavidthomas <[email protected]>
|
@copilot logic for the location of the logging dir should be in the conf crate and exported from it and used in the server crate. |
- Added log_dir() function to djls-conf that returns XDG cache directory - Updated djls-server to use djls_conf::log_dir() instead of local logic - Removed directories dependency from djls-server - Moved log directory tests to djls-conf where the logic lives Co-authored-by: joshuadavidthomas <[email protected]>
Done. Added |
- Changed log_dir() function to LOG_DIR static with LazyLock - Updated to use Camino Utf8PathBuf instead of std::path::PathBuf - Updated djls-server to dereference the static constant - Updated tests to work with the new static constant Co-authored-by: joshuadavidthomas <[email protected]>
- Changed LOG_DIR static back to log_dir() function returning Result - Moved directory creation logic from djls-server to djls-conf - Updated init_tracing to return Result and use log_dir()? - Added proper error handling with anyhow::Context - Added comprehensive documentation with Errors and Panics sections - Added test to verify directory creation Co-authored-by: joshuadavidthomas <[email protected]>
- Changed from .unwrap() to .ok() for Utf8PathBuf conversion - Now falls back to /tmp if XDG cache path contains invalid UTF-8 - Removed Panics documentation section as function no longer panics Co-authored-by: joshuadavidthomas <[email protected]>
CodSpeed Performance ReportMerging #334 will not alter performanceComparing Summary
Footnotes |
Setup server logging to file using standard XDG dir
Original prompt
Fixes #180
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.