dynamic_logger 0.5.0
dynamic_logger: ^0.5.0 copied to clipboard
A simple and structured logger for Dart applications.
0.5.0 #
- Fix: Log formatting now runs synchronously on the calling thread. The isolate-based implementation was removed in 0.4.0 but the documentation still claimed otherwise — this release corrects all misleading references.
- Feature: Added
minLeveltoconfigure(). Messages below the configured minimum severity are silently dropped without any formatting work. - Feature: Added
maxStringLengthtoconfigure()andlog(). When truncation is active, strings exceeding this length are clipped with a remaining character count (e.g."ABC"... (47 more chars)). - Feature: Added
colorEnabledtoconfigure(). Set tofalseto emit plain text without ANSI escape codes — useful for file sinks or environments without ANSI support. - Feature: Added
DynamicLogger.reset(). Restores all configuration to factory defaults. Intended for use in tests to prevent state leaking between test cases. - Fix: Removed spurious leading space in List opening bracket (was
[, now[). - Refactor: Removed unused
_LogPayloaddata class and_formatInIsolatefunction. Formatting is now inlined directly inlog()with cleaner parameter names. - Tests: Expanded test suite with coverage for all log levels, header/footer
structure,
minLevel,colorEnabled,maxStringLength,formatData,logHandlerOverride, enable/disable,reset(), and truncation edge cases.
0.4.0 #
- Docs: Updated README with the latest version.
- Refactor: Removed
dart:isolatedependency.
0.3.0 #
- Chore: Updated example file to include custom log handler configuration for better console output visibility.
- Chore: Remove dependency.
- Docs: Improved README with clearer examples and output visibility instructions.
0.2.2 #
- Feature: Added global enable/disable capability via the
enableparameter inDynamicLogger.configure. When disabled (enable: false), calls toDynamicLogger.logwill be ignored.
0.2.1 #
- Fix footer output
0.2.0 #
- BREAKING: Refactored core formatting logic for significantly improved memory efficiency, especially with large data structures. Uses
StringBuffermore effectively and reduces intermediate string creation. - Feature: Added configurable truncation for large/deep data structures:
- Introduced
maxDepthandmaxCollectionEntrieslimits. - Added
DynamicLogger.configureto set global defaults for truncation, limits, and the log handler.
- Introduced
- Added
truncate,maxDepth, andmaxCollectionEntriesparameters toDynamicLogger.logfor per-call overrides. - Feature: Added
DynamicLogger.formatDatastatic utility to format data structures into strings without logging, respecting truncation rules. - Fix: Improved JSON/List formatting to be more standard (correct indentation, quoting of strings, comma placement, handling of empty collections).
- Fix: Corrected indentation for top-level primitive/string logs to align directly under the header.
- Fix: Improved header/footer appearance using single-line box characters.
- Chore: Removed dependency on the
collectionpackage. - Chore: Added internal error handling during formatting to prevent logger crashes on unexpected data.
0.1.1 #
- Downgrade
collectionto 1.19.0
0.1.0 #
- Initial release of DynamicLogger.