app_factory_logging 0.2.0
app_factory_logging: ^0.2.0 copied to clipboard
Privacy-safe structured logging for Flutter apps — centralized redaction, app.runtime-log.v1 events, Riverpod bindings, test fakes, and breadcrumbs.
0.2.0 #
- Fixed default credential and Authorization/Cookie header redaction for quoted JSON-style keys (including whitespace, case variants, and escaped quoted values) before all outputs.
- Added the
app.runtime-log.v1structured event contract, stableeventName, one-line JSON framing, optional stage/action/status/duration, correlation IDs, error codes, bounded JSON-safe attributes, and a published JSON Schema. - Added centralized fail-closed sanitization for messages, errors, stack
traces, attributes, console output,
FakeAppLogger, and sinks. The default redactor covers common credentials, Authorization/Cookie values, URL query and fragment data, emails, and phone numbers. - Added
AppLogEventSinkandappLogEventSinkProviderfor sanitized event capture without adding a remote logging implementation. - Added
SanitizingAppLoggerfor bounded brownfield adaptation of existing custom logging backends. - Changed
AppLoggerProviderObserver.includeto filter every callback and stopped serializing provider values. - Changed
debugChunkedto sanitize the complete input before splitting and cap the number of chunks. Complete response or user payload logging is no longer a supported use case. - Kept legacy
AppLoggercall sites andAppLogSink.writesource-compatible. Built-in fakes and sinks now receive sanitized error/stack text, so callers must not rely on original object identity.ConsoleAppLogger.maxMessageLengthis now restricted to the Schema range of 0–4096 characters. - Enforced configured field and whole-event bounds after truncation, rejected processor settings outside the published Schema contract, and added runtime JSON Schema contract tests for normal, fallback, invalid, deep, and oversized events.
0.1.1 #
- Changed the license for this and future versions from MIT to the Apache License 2.0 and added the package NOTICE file.
0.1.0 #
- Breaking (pre-1.0): added
AppLogLevel.traceandAppLogger.trace(...). CustomAppLoggerimplementations and exhaustiveAppLogLevelswitches must be updated. Existing enum indexes also shift becausetraceis first. The defaultminLevel: AppLogLevel.debugcontinues to filter trace output. - Added
AppLogScopeandAppLogger.forOwner(this)to bind the owner's runtime class name once and omit handwritten tags from subsequent calls.
0.0.2 #
- Breaking (pre-1.0): console backend is terminal-only via
debugPrint. Removeddart:developer,package:logging, and the process-wideLogger.rootsubscription. - Breaking (pre-1.0): removed test helpers
debugResetForTestanddebugIsHandlerRegisteredForTest(no longer needed without a global handler). - Added
enableConsoleOutput(defaults tokDebugMode) and optionaluseAnsiColors(off by default). warn/errorstill forward toAppLogSinkfor breadcrumbs; sink failures print a single diagnostic when console output is enabled, without duplicating the exception text.- Per-instance
enableConsoleOutput/minLevelcontrol.
0.0.1 #
- Initial release:
AppLoggerabstraction,ConsoleAppLogger(truncation +debugChunked),FakeAppLogger, generated Riverpod providers,AppLogSinkinterface, and optionalAppLoggerProviderObserver.