Skip to content

feat: add dedicated log file support#126

Merged
jy-tan merged 3 commits intomainfrom
log-to-file
Apr 16, 2026
Merged

feat: add dedicated log file support#126
jy-tan merged 3 commits intomainfrom
log-to-file

Conversation

@jy-tan
Copy link
Copy Markdown
Contributor

@jy-tan jy-tan commented Apr 15, 2026

Summary

Add a --fence-log-file flag so Fence-owned monitor and debug output can be redirected to a separate file when running fullscreen TUIs, while keeping the sandboxed command's stdout and stderr unchanged.

Resolves #120.

Example usage:

fence -m --fence-log-file ./fence.log -- claude
tail -f ./fence.log

Changes

  • Add a shared internal/fencelog logger and route Fence-owned [fence:*] output through it instead of writing directly to process stderr
  • Add --fence-log-file to the CLI and propagate the resolved absolute path through helper re-execs
  • Truncate the log file once on the initial CLI invocation, then reopen it in append mode for helper re-execs so logs are not wiped mid-run
  • Cover the new logging and env propagation behavior with focused tests

@jy-tan jy-tan requested a review from dwt April 15, 2026 01:55
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 18 files

@jy-tan jy-tan merged commit ba0efc7 into main Apr 16, 2026
6 checks passed
@jy-tan jy-tan deleted the log-to-file branch April 16, 2026 07:29
@jy-tan jy-tan mentioned this pull request Apr 16, 2026
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.

-m monitoring output not readable when running full screen TUI apps like agents

1 participant