Add activity log - #22
Merged
Merged
Conversation
- Compute default log path at runtime, not compile time - Degrade gracefully on log write failures instead of crashing - Only log stopped events on clean shutdown, not crash restarts
…g you're sev has been running, and usage of overtime protocol
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.
Summary
Severance.ActivityLogmodule tracks daemon sessions (start/stop with duration) and overtime protocol usage~/.local/state/severance/activity.log(configurable vialog_filein config)sev logcommand prints the activity log to stdoutterminate/2Test plan
ActivityLog.format_entry/2formats started, overtime, and stopped entries correctlyActivityLog.log_started/1creates directory, appends entry, stores start timeActivityLog.log_overtime/1appends overtime entryActivityLog.log_stopped/1appends stopped entry with duration, handles missing start timeConfig.defaults/0includeslog_filekeyConfig.generate_contents/1round-trips withlog_fileApplication.resolve_config/2resolveslog_filefrom config file, expands tilde, stores in envCountdown.overtime/0logs overtime event to activity logCountdown.terminate/2logs stopped event with durationCLI.parse_args(["log"])returns:logCLI.run_log/1prints log contents or "no log found" messageImplementation Plan
8 tasks executed via subagent-driven development:
format_entry/2anddefault_log_file/0log_started,log_overtime,log_stopped)log_filekey to defaults andgenerate_contentslog_filefrom config, calllog_startedon daemon bootsev logcommand (parse_args, run_log, dispatch)