Skip to content

Conversation

@dev-KingMaster
Copy link

Summary

  • Adds an opt‑in browser option, browser.reportCaller.
    • Object mode (asObject or formatters): adds caller string (file:line:column) to the log object.
    • Default mode: appends the caller string as the last console argument.

Motivation

Implementation

  • Best‑effort via Error stack parsing with filtering of internal frames; browser‑only.
  • Docs: Browser API updated with usage and caveats.
  • Types: pino.d.ts updated to include reportCaller?: boolean.
  • Tests: adds coverage for asObject mode; default mode verified manually and documented (reduced assertion scope to keep tests stable across environments).

Backward compatible

  • Off by default; no changes to Node/server path.

@dev-KingMaster
Copy link
Author

Hi @jsumners Could you review the pr and leave any comments? Thanks

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@dev-KingMaster
Copy link
Author

Hi @mcollina Thanks for approval. Does this pr need to wait for another approval to be merged? Or do I have to do sth on my side?

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.

2 participants