chirp 0.8.0
chirp: ^0.8.0 copied to clipboard
A lightweight, fully customizable Dart logger with automatic caller info, zero config, rotating file writers, and structured logging.
0.8.0 #
New Features #
- New
LogRecord.wallClock, always capturingDateTime.now()vs.LogRecord.timecapturingclock.now()which can be faked in tests - New
RotatingFileWriterto write log files with automatic rotation and optional compression, including aRotatingFileReaderto consume the log files again. - Unified formatter architecture — Console and file formatters now share a single
ChirpFormatterbase class withMessageBuffer, replacing the separateConsoleMessageFormatter/FileMessageFormatterhierarchies. - Wasm support:
RotatingFileWriteris only available on non-web platforms. - Add
minLevelconstructor parameter to all writers
Breaking Changes #
- Breaking
ConsoleMessageFormatteris now a deprecated typedef forChirpFormatter— migrate custom formatters to extendChirpFormatterand useformat(LogRecord record, MessageBuffer buffer)instead offormat(LogRecord record, ConsoleMessageBuffer buffer) - Breaking
FileMessageFormatteris now a deprecated typedef forChirpFormatter— migrate custom file formatters to extendChirpFormatterand write tobuffer.fileinstead of returning aString - Breaking
JsonFileFormatterremoved — useJsonLogFormatterinstead - Breaking
JsonLogFormatter(replacesJsonMessageFormatter) simplified: removedincludeSourceLocation,includeClassAndInstance,useUtcTimestamps,JsonDataStyle,.console(), and.file()constructors. Source location and class/instance info are now always included. Timestamps are always UTC. Data fields are always written at the root level. - Deprecated
JsonMessageFormatter— useJsonLogFormatterinstead
0.7.0 #
New Features #
Structured logging for cloud platforms
- Add
GcpMessageFormatterfor Google Cloud Platform with automatic Error Reporting, sourceLocation, and trace correlation - Add
AwsMessageFormatterfor AWS CloudWatch with proper log level mapping - Add
JsonMessageFormatterfor platform-agnostic JSON output
Lambda-based APIs for inline customization
- Add
DelegatedChirpInterceptorfor creating interceptors inline with lambdas - Add
DelegatedChirpWriterfor creating writers inline with lambdas - Add
DelegatedConsoleMessageFormatterfor creating formatters inline with lambdas
New span types for custom formatters
- Add
DataKeyandDataValuespans for individual key/value rendering - Add
StackFrameInfo.packageRelativePathfor clean, package-relative file paths InlineDatanow supports custom separators viaentrySeparatorBuilderandkeyValueSeparatorBuilder
Other additions
- Add
LogRecord.copyWith()for easier log record manipulation in interceptors
Breaking Changes #
- Span-related exports moved from
package:chirp/chirp.darttopackage:chirp/chirp_spans.dart- Affected:
SpanBasedFormatter, all span classes (PlainText,AnsiStyled, etc.),colorForHash,ColorSaturation - Migration: Add
import 'package:chirp/chirp_spans.dart';if using custom formatters
- Affected:
Bug Fixes #
- Fix child logger not inheriting parent's
minLogLevel - Fix
Alignedspan ignoring ANSI escape codes in padding calculation - Fix
StackTraceSpanadding extra blank line due to trailing newline
Improvements #
- Remove dimmed styling from log messages without level color for better readability
Deprecations #
- Deprecate
RainbowMessageFormatter.metaWidth(no longer has any effect)
0.6.0 #
- First public release to pub.dev
- Rework of ANSI colors, now with truecolor support and detection
- Interceptors for filtering and manipulation
minLogLevelfor fast level based filtering- Optional
Stacktrace.currentcapturing
0.5.0 #
- First working prototype