mirror of
https://github.com/Nanaloveyuki/BitLogger.git
synced 2026-05-30 15:42:25 +00:00
4.5 KiB
4.5 KiB
BitLogger Update Changes
version 0.3.0
Feature
- feat: add
config.mbtas a minimal JSON-backed logger configuration layer - feat: add
TextFormatterConfig,QueueConfig, andLoggerConfigpublic config types - feat: add
TextFormatterConfig::new(...),QueueConfig::new(...), andLoggerConfig::new(...)constructors for explicit config assembly - feat: add
SinkKindandSinkConfigfor sink-specific configuration - feat: add
TextFormatterConfig::to_formatter()for bridging parsed config into runtime formatter setup - feat: add
parse_logger_config_text(...)for JSON config parsing - feat: add
logger_config_to_json(...)andstringify_logger_config(...)for config serialization - feat: add
RuntimeSink,ConfiguredLogger,build_logger(...), andparse_and_build_logger(...)for config-driven logger assembly - feat: add
ConfiguredLogger::drain(...),ConfiguredLogger::pending_count(), andConfiguredLogger::dropped_count()queue observability helpers - feat: add
bitlogger_async/as a separate native-target async adapter package - feat: add
AsyncLogger,async_logger(...),run(),wait_idle(),close(),pending_count(), anddropped_count()on top ofmoonbitlang/async - feat: add async logger composition helpers
with_context_fields(...),with_filter(...),with_patch(...),with_target(...),child(...), andwith_timestamp(...) - feat: add
AsyncLoggerBuildConfig,parse_async_logger_build_config_text(...), andbuild_async_logger(...)for config-driven async logger assembly - feat: add async lifecycle helpers
shutdown(),is_closed(),is_running(),has_failed(), andlast_error()for safer worker teardown and observability - feat: add
parse_async_logger_config_text(...),stringify_async_logger_config(...), and build-config serialization helpers for async config roundtrip support - feat: add async batching controls
max_batchandflush=Never|Batch|Shutdownfor queue draining and flush timing - feat: expose
Record::new(...)for adapter and integration layers - fix: repair native file backend FFI declarations so native target checks succeed again
- feat: support config keys
min_level,target,timestamp,sink.kind,sink.path,sink.append,sink.auto_flush,sink.text_formatter, andqueue - feat: support config-driven sink assembly for
console,json_console,text_console, andfile - feat: use
maria/json_parseras the first external dependency for practical config loading - feat: add
TextFormatter.templateandTextFormatterConfig.templatefor template-driven text rendering - feat: support formatter tokens
{timestamp},{timestamp_ms},{level},{target},{message}, and{fields}in both runtime and JSON config paths
Test
- test: cover parsing of core logger config fields
- test: cover nested formatter and queue config parsing
- test: cover config stringify and parse roundtrip behavior
- test: cover config-built queued text logger flushing and pending count behavior
- test: cover partial drain behavior for config-built queued logger
- test: cover dropped-count reporting for bounded config-built queue
- test: cover template-based formatter rendering and disabled token behavior
- test: add async logger lifecycle, config roundtrip, and batching/flush policy test seeds
- build: verify
bitlogger_async --target nativeandexamples/async_basic --target nativecompile successfully
Example
- docs: update
examples/basicwith JSON config loading example - docs: update
examples/basicto useparse_and_build_logger(...)with explicit error handling inmain - docs: add
examples/async_basicto show async worker startup and queue-backed logging flow - docs: update
examples/async_basicto use unified JSON-driven async logger config - docs: update root README, English README, and Mooncake README with config usage notes
- docs: update formatter examples to demonstrate template-based text rendering
- docs: update root README and English README with async adapter notes and current scope
- chore: ignore local
.mooncakes/cache directory in git
Notes
- current config scope is still intentionally constrained to stable built-in sink shapes
- formatter templates are intentionally limited to simple token replacement and do not yet include conditional blocks or alignment/padding controls
- queue wrapping remains synchronous drain-based delivery, not async runtime scheduling
- async logging remains an isolated adapter layer and currently targets
native/llvmonly