Skip to content

logging: add '-l' arg to set logging level#4

Merged
fgiudici merged 2 commits intomainfrom
issue2
Feb 13, 2026
Merged

logging: add '-l' arg to set logging level#4
fgiudici merged 2 commits intomainfrom
issue2

Conversation

@fgiudici
Copy link
Copy Markdown
Owner

The logging level can now be set either with the "log-level"/"l" parameter or the LOG_LEVEL environment variable.

Added the TRACE level to dump in logs all the inspected HTTP headers.

Fixes #2

The logging level can now be set either with the "log-level"/"l"
parameter or the LOG_LEVEL environment variable.

Added the TRACE level to dump in logs all the inspected HTTP headers.

Fixes #2

Signed-off-by: Francesco Giudici <dev@foggy.day>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request implements command-line control for logging levels, addressing issue #2. It adds a new -l/--log-level flag to configure logging verbosity and introduces a TRACE level for maximum verbosity. The implementation allows the flag to override the LOG_LEVEL environment variable, providing flexible logging configuration through both command-line and environment variables.

Changes:

  • Added TRACE as the most verbose logging level for dumping all HTTP headers
  • Implemented -l/--log-level command-line flag that overrides LOG_LEVEL environment variable
  • Enhanced debug logging to show configuration details at startup

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
pkg/logging/logging.go Added TRACE level constant, implemented Tracef() function, and updated documentation to include TRACE level
pkg/headers/headers.go Improved log message terminology from "Dropping" to "Redact" and added TRACE logging for all headers
cmd/cmd.go Added log-level flag, integrated flag value into logging initialization, and added debug logging for startup configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/cmd.go
Signed-off-by: Francesco Giudici <dev@foggy.day>
@fgiudici fgiudici merged commit d721b96 into main Feb 13, 2026
1 check passed
@fgiudici fgiudici deleted the issue2 branch February 13, 2026 12:11
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.

logging: add a command line parameter to configure the logging level

2 participants