Skip to content

Move logger setup to after MODE selection - #126

Merged
ldayton merged 3 commits into
ldayton:mainfrom
nickdavies:log_path
Jun 8, 2026
Merged

Move logger setup to after MODE selection#126
ldayton merged 3 commits into
ldayton:mainfrom
nickdavies:log_path

Conversation

@nickdavies

Copy link
Copy Markdown
Contributor

Because we call setup_logging before deciding on the mode the log file is always .claude/hook-approvals.log even for cursor

This split the logger setup in two, first we do basic logging setup with the right format etc so that we don't lose messages related to parsing input and setup and then once we know the mode we are in we call the file logger.

Nick Davies and others added 3 commits March 24, 2026 09:06
Because we call `setup_logging` before deciding on the mode the log file
is always `.claude/hook-approvals.log` even for cursor

This split the logger setup in two, first we do basic logging setup with
the right format etc so that we don't lose messages related to parsing
input and setup and then once we know the mode we are in we call the
file logger.
basicConfig(level=INFO) attached an INFO stderr handler, so every decision
printed to stderr on each invocation. Set root+file to INFO (audit log
unchanged) but the stderr handler to WARNING, so only early failures (bad
JSON, unknown tool) surface there.
@ldayton
ldayton merged commit 324d2a2 into ldayton:main Jun 8, 2026
1 check passed
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.

2 participants