Skip to content

feat(deno): Export logs API from Deno SDK#19313

Merged
sergical merged 3 commits intodevelopfrom
feat/deno-logs
Feb 16, 2026
Merged

feat(deno): Export logs API from Deno SDK#19313
sergical merged 3 commits intodevelopfrom
feat/deno-logs

Conversation

@sergical
Copy link
Member

@sergical sergical commented Feb 13, 2026

Summary

  • Re-export logger and consoleLoggingIntegration from @sentry/core in the Deno SDK
  • Add integration test verifying logger.info() produces a log envelope item with correct level and body

Test plan

  • yarn build:dev:filter @sentry/deno — builds successfully
  • cd packages/deno && yarn test — all 13 tests pass
  • eslint packages/deno/src/index.ts — no lint errors

🤖 Generated with Claude Code

Closes #19314 (added automatically)

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 14 uncovered lines.
✅ Project coverage is 83.13%. Comparing base (base) to head (head).

Files with missing lines (2)
File Patch % Lines
mute.js 79.10% ⚠️ 14 Missing and 7 partials
etoa.js 100.00% ⚠️ 1 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    61.39%    83.13%   +21.74%
==========================================
  Files          789         2      -787
  Lines        43246        83    -43163
  Branches      8353        57     -8296
==========================================
+ Hits         26558        69    -26489
- Misses       16688        14    -16674
- Partials        83         8       -75

Generated by Codecov Action

@chargome chargome self-assigned this Feb 13, 2026
Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing we will need to adapt is the flushing logic for logs for server exits. The node equivalent is process.on('beforeExit') in the node-core package

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: Please export the according Log and LogSeverityLevel types here too

@sergical sergical requested a review from chargome February 13, 2026 15:07
/** @inheritDoc */
// @ts-expect-error - PromiseLike is a subset of Promise
public async close(timeout?: number | undefined): PromiseLike<boolean> {
if (this._logOnExitFlushListener) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: Couldn't we just flush in here? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the clanker was basing the implementation on the node-core implementation where he said

The same pattern exists in packages/node-core/src/sdk/client.ts — its close() also only removes the beforeExit listener without flushing.

should we update?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your call, both are fine for me!

Copy link
Member Author

@sergical sergical Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the cleanest fix is to add _INTERNAL_flushLogsBuffer(this) to the base Client.close() in packages/core so all SDKs (node-core, deno, bun, cloudflare) benefit. Tracking in a separate issue so we can merge this as-is.

#19347

sergical and others added 3 commits February 16, 2026 11:16
Re-export `logger` and `consoleLoggingIntegration` from `@sentry/core`
so Deno users can use `Sentry.logger.info(...)` and capture console
calls as Sentry logs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Export `Log` and `LogSeverityLevel` types from the Deno SDK. Add log
buffer flushing on server exit via `globalThis.addEventListener('unload')`
(Deno's equivalent of Node's `process.on('beforeExit')`), matching the
pattern in node-core's NodeClient. Also adds `server.address` attribute
to logs via `beforeCaptureLog` hook.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sergical sergical merged commit bd59033 into develop Feb 16, 2026
36 checks passed
@sergical sergical deleted the feat/deno-logs branch February 16, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(deno): Export logs API from Deno SDK

2 participants