Skip to content

Add minLevel constructor parameter to all writers#28

Open
passsy wants to merge 1 commit intomainfrom
issue-27-level-filter
Open

Add minLevel constructor parameter to all writers#28
passsy wants to merge 1 commit intomainfrom
issue-27-level-filter

Conversation

@passsy
Copy link
Owner

@passsy passsy commented Feb 3, 2026

Summary

  • Adds minLevel constructor parameter to RotatingFileWriter, PrintConsoleWriter, and DeveloperLogConsoleWriter
  • Provides a convenient way to set minimum log level directly in the constructor instead of chaining setMinLogLevel()

Example

// Before - requires chaining
final writer = RotatingFileWriter(
  baseFilePath: '/var/log/app.log',
)..setMinLogLevel(ChirpLogLevel.warning);

// After - constructor parameter
final writer = RotatingFileWriter(
  baseFilePath: '/var/log/app.log',
  minLevel: ChirpLogLevel.warning,
);

Test plan

  • Added tests for minLevel constructor parameter on all three writers
  • Verified filtering works correctly when used with ChirpLogger
  • Verified minLogLevel property is set correctly
  • All 819 existing tests pass

Closes #27

🤖 Generated with Claude Code

Adds a convenient `minLevel` constructor parameter to:
- RotatingFileWriter
- PrintConsoleWriter
- DeveloperLogConsoleWriter

This allows setting the minimum log level directly in the constructor
instead of chaining setMinLogLevel() after construction.

Closes #27

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.

Add level filter for RotatingFileWriter

1 participant