Repository navigation
v0.6.0
Added
sendFeedback(text, extras?)— capture what error tracking structurally cannot see. A button that does nothing, a wrong total, the wrong data rendered: none of them throw, so none are logged. Feedback captures that class, and the breadcrumb trail already in memory turns "the discount didn't apply" from a complaint into a reproduction. Headless — the app owns the UI. Carries the same labels and breadcrumbs as any log, plus an optional screenshot.NOTICEseverity — ranks betweenINFOandWARNING, matching Cloud Logging's own ordering. Feedback from a person outranks routine status without being a warning about system health, and any existingseverity >= WARNINGalert ignores it with no configuration. This widens the publicLogSeverityunion, which is breaking for exhaustiveswitchstatements andRecord<LogSeverity, T>in consumer code.
Changed
- The 5-minute breadcrumb cutoff now applies when reading, not only when writing. It previously lapsed exactly when nothing was happening: a user who went idle for ten minutes and then hit an error shipped a trail of ten-minute-old steps presented as the path that led there.
- Every log now carries the full breadcrumb trail (up to 50 entries), not the newest 20. The trail already retained 50; the send path asked for 20, so 30 were kept in memory that nothing could read. Error and feedback payloads grow by roughly 3 KB, or ~2% of Cloud Logging's 256 KB entry limit.
Removed
Breaking: initRequestLogger is gone. Use withLogging. It bound the request scope with AsyncLocalStorage.enterWith(), which is never unwound, so a request's labels outlived the request — a later handler that did not call it inherited whichever user last touched the warm instance. Deprecated in 0.5.0 with a warning naming the leak. withLogging binds with run(), which restores the previous context when the handler settles, including on a throw.
Breaking: setActiveActivity and BaseLabels.activity are gone. activity was ambient state with no natural end — nothing cleared it automatically, so a forgotten one contaminated the rest of the session, and because it fed the dedup signature a stale value distorted which errors were suppressed. A wrong signal in a filtering rule is worse than a missing one. screen looks similar but is self-correcting: the next setScreen() overwrites it. Nothing set activity in practice, so removing it from the signature changes no behaviour — the segment was always empty. See #29 for restoring path discrimination from breadcrumbs, which are derived rather than manually maintained and therefore cannot go stale.
Fixed
- An unrecognised severity crashed
writeLogand destroyed the entry — both dispatch paths look the value up in a fixed table (CONSOLE_FNin emulator mode,firebase-functions' ownCONSOLE_SEVERITYinsideffWrite), and a miss resolves toundefined; calling it throws,Logger.send()'s catch swallows it, and the entry disappears with no diagnostic. It also slipped past the min-severity floor, sinceSEVERITY_ORDER[unknown]isundefinedandundefined > nisfalse.writeLogis exported, so a caller could reach it with a value read from config, crossing a type boundary, or from plain JavaScript. Unknown severities are now written asERRORwith a warning naming the bad value — an entry arriving loud beats one vanishing quietly.