hyper_logger 0.4.0
hyper_logger: ^0.4.0 copied to clipboard
Composable logging for Dart and Flutter with exact secret redaction, scoped context, file rotation, and cloud-ready JSON for GCP, AWS, and Azure.
0.4.0 #
Breaking #
- Rename the
exceptionnamed parameter toerroracross static, scoped, and mixinwarning(),error(), andfatal()APIs. No compatibility alias is provided; callers andScopedLoggerApiimplementations must migrate. - Extend
ScopedLoggerApi.warning, so custom implementations and test doubles must accept the new optionalerrorandstackTracenamed parameters.
Added #
- Allow static, scoped, and mixin warning calls to attach an
errorandstackTraceas structured log fields. Error-bearing warnings retain warning severity and remain crash-reporting breadcrumbs rather than non-fatal error reports.
0.3.0 #
Added #
- Add
HyperLogger.shutdown()for graceful teardown that stays disabled until the next explicitinit(). - Add null-safe
copyWithtransformations toLogEntryandLogMessage. - Add an ordered, fail-closed
sanitizerschain that protects printers and crash-reporting delegates after ordinary interceptors. - Rebuild
RedactingInterceptoraround exact structured keys and paths, HTTP field names, URI/form parameter names, JSON decoding, RFC 7468 boundaries, bounded traversal, and configured literal secrets. Literal matching uses a bounded linear-time multi-pattern automaton, with fail-closed limits on matcher construction and sanitized output expansion. - Add explicit environment-secret collection, application-object encoders, exact wildcard paths, and configurable unknown-value handling.
- Add a standards-backed redaction guide covering exact behavior, limits, performance, testing, and limitations; mirror every cited source in the public Dart API documentation.
Changed #
- Skip record allocation, conversion, interceptors, and sanitizers when the current mode and routing flags leave no eligible printer or crash delegate.
- Route native calls directly into the sanitized pipeline;
package:loggingremains an inbound bridge for third-party records and never broadcasts raw HyperLogger payloads to unrelated root-stream subscribers. Code that relied on observing HyperLogger-native calls throughLogger.root.onRecordshould use aLogPrinter, interceptor, or sanitizer instead. - Make
LogEntry.messageandLogEntry.loggerNamecanonical across built-in printers and synchronize theLogMessage.messagecompatibility mirror after every interceptor and sanitizer stage. - Expose
LogMessage.reportToCrashReportingas immutable routing metadata so custom printers can honorskipCrashReporting; delegate dispatch still uses the pipeline's internal routing decision. - Replace the redactor's
sensitiveKeyPatternparameter with exactRedactionPolicysets. Migration: configuresensitiveKeys,sensitiveHeaderNames, andsensitiveQueryParameters, and pass the new required exactenvironmentKeyslist tofromEnvironment. - Skip stack-trace inspection and chain construction when the effective
methodCountis zero;errorMethodCountremains the error-entry override.
Security #
- Ensure sanitizer exceptions and
nullresults drop entries before every configured sink instead of restoring an earlier unsanitized value. - Revalidate changed candidates to a bounded fixed point so replacement composition cannot synthesize an unchecked JSON, HTTP, URI/form, literal, or final structured-path representation.
- Reject duplicate decoded names in selected environment JSON, cycles,
unsupported values when
UnknownValueHandling.dropEntryis selected, and all configured resource-limit violations. - Keep constructor and pipeline diagnostics generic so confidential input is not reflected through errors.
0.2.2+2 #
- Shrink the published archive from 1.1 MB to 168 KB. The README and docs now
reference the preview images by absolute GitHub URL, so pub.flutter-io.cn proxies them
from the repository and the PNGs no longer ship to every
pub get. The images themselves are back to full 2x resolution.
0.2.2+1 #
- Restore the README preview images on pub.flutter-io.cn. 0.2.2 excluded
assets/from the published archive.
0.2.2 #
- Compress assets & add .pubignore.
LogPrinterPresets.automatic,.human,.terminal, and.cinow forward the fullComposablePrintertuning surface —methodCount,errorMethodCount,excludePaths,showAsyncGaps, andsuppressTypeNames. Previously a preset only tookoutput, so tuning stack-trace depth or frame filtering meant abandoning the preset and composing the decorator list by hand. Onautomaticthe parameters reach theci/humanarms only; the cloud arms emit a rawstackTrace.toString()and have nothing to tune.ComposablePrinter.defaultMethodCount— the default frame count (10), exposed so wrappers can mirror it instead of copying the literal.
0.2.1 #
- Shorten the package description to satisfy pub.flutter-io.cn's character guideline.
0.2.0 #
Breaking #
-
RotatingFilePrinterrotation API redesigned. The singlerotationConfig: FileRotationConfig.…parameter is replaced by:rotations: List<FileRotation>— a list of rotation rules, each a trigger (FileRotation.size/.interval/.daily/.onStart) crossed with aCadence(continuous, checked on every write, oronStart, checked once when the file opens). Rules compose as a union (the first to fire rotates), so size and time triggers can now be combined. An empty list (the default) appends forever.retention: FileRetention?— shared archive policy (maxFiles,maxAge,compress).maxBytes/intervalnow live on the rule; retention knobs moved here.FileRotationConfigis removed.
Migration:
FileRotationConfig.size(maxBytes: N, maxFiles: M, compress: c)→rotations: [FileRotation.size(N)], retention: FileRetention(maxFiles: M, compress: c);FileRotationConfig.interval(interval: D)→rotations: [FileRotation.interval(D)].
Added #
FileRotation.onStart({bool discard})— rotate (archive) or discard the existing log on every process start, e.g. a freshserver.logper run.FileRetention.maxAge— delete rotated archives older than a given duration (age parsed from the archive's filename timestamp), pruned on each rotation alongsidemaxFiles.
0.1.0 #
- Initial public release.