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

all args, not just in catch? #13

Open
ThomasGHenry opened this issue Feb 24, 2021 · 2 comments
Open

all args, not just in catch? #13

ThomasGHenry opened this issue Feb 24, 2021 · 2 comments
Labels

Comments

@ThomasGHenry
Copy link

I'm loving the babel auto logger. It's super helpful. I'm not seeing how to log the arguments for non-catch block calls. Is that possible? Thanks!

@ThomasGHenry
Copy link
Author

For example, most calls look like this first one, and only catch calls look like the second.

{
  source: '[/src/app/models/effort-pay-period.model.js:6:43]',
  name: 'exports'
}
{
  source: '[/src/app/lib/EffortVarianceDetection.js:69:18]',
  name: 'catchClause',
  args: [
    Error: Effort Pay Period not found for ID: undefined

@pauldcomanici
Copy link
Owner

pauldcomanici commented Apr 16, 2021

I'm glad @ThomasGHenry that you consider this helpful. Sorry for the late reply 😅

As of now, arguments can be logged only in the context of catch clause or member expression catch.

You are welcome to submit the needed changes that will allow logging arguments for other use cases.

Before going ahead with the implementation, some parts that need to be taken into consideration:

  • the ability to configure how arguments are logged (similar options as we have for the errors)
  • the ability to configure where we want to have arguments logged (maybe pattern matching? , function matching? ). This will allow adding args only when we want.
  • the ability to configure at the log level. Maybe for verbose logging, we do not want arguments at all.
  • some way to filter data from the arguments, this most probably will be in the responsibility of the logger function used, but if we can do something that we can do ... we should think about it.

Those are the things that I can think of right now, if there are other points to take into consideration please add.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants