LogTape 2.4.0 is out. #LogTape is a zero-dependency #logging library for #JavaScript and #TypeScript that runs on #Deno, #Node.js, #Bun, and browsers.
The main changes:
- Opt-in source locations:
captureSourceLocationrecords where each log call was made, and the text formatters can show it. Meant for development, since it costs a stack trace per call. inspectLogger()reports how a logger's level, inherited sinks, and filters combine, so you can see why a record doesn't reach a sink.parentSinks: "forward"lets a child category inherit its ancestors' sinks without their level thresholds.drain()waits for pending sink output without disposing of the sinks, andfromAsyncSink()gets queue limits and awaitUntilhook for serverless platforms.fingersCrossed()can go back to buffering after a trigger, and flush or discard buffers per request.- The Express, Hono, Koa, and Elysia integrations take a
completionLevelcallback that picks the log level from the response.
Two changes can affect existing code: getRotatingFileSink() now requires maxFiles to be an integer from 1 to 1,000, and TextFormatterOptions.value now also accepts "bare", so code that calls it directly has to check its type first.