Skip to content

Add activity log - #22

Merged
KTSCode merged 13 commits into
mainfrom
todo/activity_log
Apr 16, 2026
Merged

Add activity log#22
KTSCode merged 13 commits into
mainfrom
todo/activity_log

Conversation

@KTSCode

@KTSCode KTSCode commented Apr 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • New Severance.ActivityLog module tracks daemon sessions (start/stop with duration) and overtime protocol usage
  • Plain-text log file at ~/.local/state/severance/activity.log (configurable via log_file in config)
  • New sev log command prints the activity log to stdout
  • Countdown GenServer logs overtime activation and session stop (with duration) via terminate/2

Test plan

  • ActivityLog.format_entry/2 formats started, overtime, and stopped entries correctly
  • ActivityLog.log_started/1 creates directory, appends entry, stores start time
  • ActivityLog.log_overtime/1 appends overtime entry
  • ActivityLog.log_stopped/1 appends stopped entry with duration, handles missing start time
  • Config.defaults/0 includes log_file key
  • Config.generate_contents/1 round-trips with log_file
  • Application.resolve_config/2 resolves log_file from config file, expands tilde, stores in env
  • Countdown.overtime/0 logs overtime event to activity log
  • Countdown.terminate/2 logs stopped event with duration
  • CLI.parse_args(["log"]) returns :log
  • CLI.run_log/1 prints log contents or "no log found" message
  • Full quality suite passes (format, compile, credo, dialyzer, 240 tests, 59.3% coverage)
Implementation Plan

8 tasks executed via subagent-driven development:

  1. ActivityLog module with format_entry/2 and default_log_file/0
  2. ActivityLog file I/O (log_started, log_overtime, log_stopped)
  3. Config — add log_file key to defaults and generate_contents
  4. Application — resolve log_file from config, call log_started on daemon boot
  5. Countdown — log overtime on activation, log stopped on terminate
  6. CLI — sev log command (parse_args, run_log, dispatch)
  7. Documentation — README usage, config example, CHANGELOG
  8. Full quality check

@KTSCode
KTSCode merged commit a7604c4 into main Apr 16, 2026
1 check passed
@KTSCode
KTSCode deleted the todo/activity_log branch April 16, 2026 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant