Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature #21133] Add skip_header option #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

viralpraxis
Copy link

@viralpraxis viralpraxis commented Feb 12, 2025

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

Copy link
Contributor

@jeremyevans jeremyevans left a comment

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.

@viralpraxis viralpraxis force-pushed the add-skip-header-option branch from 561f3a2 to 7e2e9e3 Compare February 14, 2025 10:49
@viralpraxis viralpraxis changed the title Add skip_header option [Feature #21133] Add skip_header option Feb 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.
@viralpraxis viralpraxis force-pushed the add-skip-header-option branch from 7e2e9e3 to 552b075 Compare February 14, 2025 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants