mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-05-30 23:52:27 +00:00
3.2 KiB
3.2 KiB
BitLogger Update Changes
version 0.2.0
Feature
- feat: add
BufferedSink[S]with in-memory buffering support - feat: add
buffered_sink(...)constructor with configurableflush_limit - feat: add
BufferedSink::flush()for manual drain - feat: add
BufferedSink::pending_count()for buffer inspection in tests and integration code - feat: add
FilterSink[S]for predicate-based record filtering - feat: add
filter_sink(...)constructor for composable sink routing - feat: add
Logger::with_filter(...)as a higher-level chained filter entry point - feat: add reusable filter helpers such as
target_is(...),target_has_prefix(...),message_contains(...),level_at_least(...),has_field(...), andfield_equals(...) - feat: add predicate combinators
all_of(...),any_of(...), andnot_(...) - feat: add
PatchSink[S],patch_sink(...), andLogger::with_patch(...)for record transformation - feat: add record patch helpers such as
prefix_message(...),set_target(...),append_fields(...),redact_field(...),redact_fields(...), andcompose_patches(...) - feat: add
QueuedSink[S],queued_sink(...), andLogger::with_queue(...)for explicit queued delivery - feat: add
QueueOverflowPolicywithDropNewestandDropOldestbounded-backlog strategies - feat: add configurable text formatter APIs
text_formatter(...),format_text(...), andformat_json(...) - feat: add formatter-based sinks
formatted_console_sink(...),text_console_sink(...),formatted_callback_sink(...), andtext_callback_sink(...) - feat: add native-only
file_sink(...)plusnative_files_supported()backend capability detection - feat: add explicit file sink lifecycle helpers
FileSink::is_available(),flush(), andclose()
Test
- test: cover manual flush behavior for buffered sink
- test: cover auto flush when buffered records reach the configured limit
- test: cover predicate-based forwarding for filter sink
- test: cover chained
Logger::with_filter(...)behavior with child target composition - test: cover helper-based filter composition for target, level, message, and field matching
- test: cover record patch composition, target rewrite, message rewrite, field append, and field redaction
- test: cover queue drain order, bounded backlog drop behavior, and chained
Logger::with_queue(...)usage - test: cover formatter customization, formatter-only message mode, formatted callback output, and JSON formatter shape
- test: cover backend-aware file sink availability and lifecycle behavior
- test: keep callback-based composition validation with child target, context fields, and timestamp enabled
Example
- docs: update
examples/basicto demonstrate buffered sink usage - docs: update
examples/basicto demonstrate filter sink usage - docs: update examples and README with helper-based chained logger filter usage
- docs: update examples and README with record patch usage for redaction and enrichment
- docs: update examples and README with explicit queued sink usage and overflow policy examples
- docs: update examples and README with configurable text formatter usage
- docs: update examples and README with native file sink usage and backend caveat
- docs: keep README focused on public usage and move change tracking to
docs/changes/