Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option.stackAdjustment #125

Merged
merged 3 commits into from
Feb 21, 2023
Merged

Add option.stackAdjustment #125

merged 3 commits into from
Feb 21, 2023

Conversation

g-gundam
Copy link
Contributor

@g-gundam g-gundam commented Feb 21, 2023

I added a new option stackAdjustment to pino-caller to help people fine tune which stack frame they want to use for logging purposes. It's needed by people who have wrapped pino, because the default behavior gets the wrong frame, but if a small constant adjustment could be applied, the right frame could be found.

This should address the concerns in issue #90.

g-gundam added 3 commits February 18, 2023 18:53
This allows users to customize where in the stack to pull info
from, and its main audience is people who have written wrappers around
pino.

The default stack level that pino-caller uses is wrong for these people,
but a small constant adjustment (usually of 1) is enough to fix this.
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

@coveralls
Copy link

Coverage Status

Coverage: 100.0%. Remained the same when pulling ac274a5 on g-gundam:master into 9480695 on pinojs:master.

@mcollina mcollina merged commit 67b318c into pinojs:master Feb 21, 2023
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.

3 participants