Skip to content

feat: structured logging to file via slog#134

Merged
owainlewis merged 2 commits into
mainfrom
codex/neo-18-structured-logging
Jun 22, 2026
Merged

feat: structured logging to file via slog#134
owainlewis merged 2 commits into
mainfrom
codex/neo-18-structured-logging

Conversation

@owainlewis

Copy link
Copy Markdown
Owner

Summary

  • add a shared discard-by-default slog logger initialized from \
  • trace agent turns, tool execution, provider retries/status, and TUI lifecycle with safe payload handling
  • add tests for enabled/disabled logging, verbose payload behavior, and secret redaction

Closes #18

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 98c9f9cae1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/logx/logx.go
}

func PayloadValue(payload string) slog.Value {
payload = redactString(payload)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid hashing payloads when logging is disabled

When NEO_LOG is unset (the default), every logx.Debug call still evaluates its arguments before the discard logger sees them, so PayloadValue redacts and SHA-256 hashes full request/response/tool bodies even though nothing will be written. This is especially costly for uncapped tool output because runTool logs out before the caller applies capToolResultContent, so a large bash output now gets an extra full scan/hash in normal runs; short-circuit this helper or its call sites when logging is disabled.

Useful? React with 👍 / 👎.

# Conflicts:
#	cmd/neo/main.go
#	internal/tui/model.go
@owainlewis owainlewis merged commit 2a68d57 into main Jun 22, 2026
2 checks 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.

Structured logging to file via slog

1 participant