Skip to content

Merge debug logger into file logger with text-only output#160

Merged
pelikhan merged 3 commits into
mainfrom
copilot/merge-debug-into-file-logger
Jan 11, 2026
Merged

Merge debug logger into file logger with text-only output#160
pelikhan merged 3 commits into
mainfrom
copilot/merge-debug-into-file-logger

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 11, 2026

Debug loggers created with logger.New() now write to both stderr (with colors/time diffs) and the file logger (text-only). This ensures all debug output is persisted to files for production troubleshooting while maintaining real-time colored output during development.

Changes

  • internal/logger/logger.go: Modified Printf() and Print() to call LogDebug() after stderr output
  • internal/logger/logger_test.go: Added tests validating dual-output behavior and disabled logger behavior
  • Documentation: Updated logger/README.md, AGENTS.md, and .github/workflows/go-logger.md to reflect dual-output semantics

Behavior

var log = logger.New("pkg:file")

// When DEBUG=pkg:* is set:
log.Printf("Processing %d items", 42)
// → stderr: pkg:file Processing 42 items +125ms (with colors)
// → file:   [2026-01-11T18:00:00Z] [DEBUG] [pkg:file] Processing 42 items

The file logger captures all enabled debug logs regardless of terminal availability, while stderr output remains conditional on the DEBUG environment variable pattern matching.

Original prompt

Merge debug logger into file logger (text only), update go log improver prompt.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 11, 2026 18:05
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Merge debug logger into file logger Merge debug logger into file logger with text-only output Jan 11, 2026
Copilot AI requested a review from pelikhan January 11, 2026 18:09
@pelikhan pelikhan marked this pull request as ready for review January 11, 2026 18:20
@pelikhan pelikhan merged commit b457931 into main Jan 11, 2026
3 checks passed
@pelikhan pelikhan deleted the copilot/merge-debug-into-file-logger branch January 11, 2026 18:33
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