Skip to content

event_flatstore improvement: new header parameter #3650

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

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

Conversation

nikbyte
Copy link
Member

@nikbyte nikbyte commented May 21, 2025

Summary

This PR adds per-file headers to the event_flatstore module.
With the new header parameter, you can write an arbitrary string (e.g. CSV column names) as the very first line of every newly created or rotated log file — making it easier to work with parsers and analysis tools.

Details

  • Current behavior
    When a flatstore log file is rotated, the new file starts immediately with data lines — no header is added.

  • Problem
    Many downstream tools expect a header row (e.g. in CSV files). Manually injecting headers after rotation is error-prone and inconvenient. Letting the module write the header automatically ensures consistency.

Solution

  • New parameter
Parameter Type Default Notes
header string (empty string) Written as the first line of every new file. No trailing newline required. UTF-8 supported.

When the module opens a new file (initial, rotated, or reopened), it will prepend this string as a line if header is set.

Compatibility

  • Fully backwards-compatible — if header is not configured, behavior remains unchanged.

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.

1 participant