Skip to content

[Feature #21133] Add skip_header option - #119

Merged
hsbt merged 1 commit into
ruby:masterfrom
viralpraxis:add-skip-header-option
Mar 11, 2025
Merged

[Feature #21133] Add skip_header option#119
hsbt merged 1 commit into
ruby:masterfrom
viralpraxis:add-skip-header-option

Conversation

@viralpraxis

@viralpraxisviralpraxis commented Feb 12, 2025

Copy link
Copy Markdown
Contributor

Creating a logger automatically writes a hardcoded header comment ("# Logfile created on ...").
While this helps verify that logdev is writable as early as possible (rather than on the first log entry), it also serves as a useful indicator of which program created the logfile.

However, this header can introduce unnecessary
complexity -- especially when working with third-party tools that need to ignore these lines.

This commit introduces a skip_header boolean
option (default is false), allowing API consumers to disable the header if needed.

issue: https://bugs.ruby-lang.org/issues/21133

@jeremyevansjeremyevans left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not the logger maintainer, but I think this is a useful feature, and the implementation looks fine.

@viralpraxisviralpraxis changed the title Add skip_header option[Feature #21133] Add skip_header optionFeb 14, 2025
ref: https://bugs.ruby-lang.org/issues/21133
Creating a logger automatically writes a hardcoded
header comment ("# Logfile created on ...").
While this helps verify that logdev is writable as
early as possible (rather than on the first log entry),
it also serves as a useful indicator of which program created
the logfile.
However, this header can introduce unnecessary
complexity -- especially when working with third-party
tools that need to ignore these lines.
This commit introduces a `skip_header` boolean
option (default is `false`), allowing API consumers
to disable the header if needed.
Sign up for freeto 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.

3 participants

@viralpraxis@jeremyevans@hsbt