-
Notifications
You must be signed in to change notification settings - Fork 110
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
Feature/proxied caller config #192
Feature/proxied caller config #192
Conversation
… trace to obtain the caller information (for example when using custom LoggerService instead of injecting the NGXLogger)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
I think it would be a nice addition. It would make sense to let the user choose how many steps should be skipped (in the PR, it is assumed this number is always 1
).
Could you update the PR to a proxiedSteps: number
and use that number instead of the boolean
?
…teps When looking in stack trace, the user can now, the user is now allowed to specify a number of lines that will be ignored The parameter is proxiedSteps in LoggerConfig
@qortex I just updated the PR so that we have a number instead of a boolean, also added a comment on the config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super useful. Thanks
sorry guys, slept on the job! |
Thanks for sorting 👍 |
I have added configuration option called proxiedCaller, if this option is set to true then the caller information is resolved with an offset of +1.
This is useful when using an abstraction over the
NGXLogger
such as a customLoggerService
, that uses an injectedNGXLogger
. In this scenario the caller information would always point to theLoggerService
file, which is not very useful. With proxiedCaller: true configuration the caller information will be resolved to that which is calling theLoggerService
and not theNGXLogger
.Default value of
undefined
does not change the current behavior, user must opt-in with a value oftrue
to enable the new behavior.