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

Consola setReporters not showing logs with stack trace #262

Open
1 task
kasadawa opened this issue Nov 20, 2023 · 0 comments
Open
1 task

Consola setReporters not showing logs with stack trace #262

kasadawa opened this issue Nov 20, 2023 · 0 comments

Comments

@kasadawa
Copy link

Describe the feature

As looking into the web for this consola, I saw the example below, which is used as a boilerPlate for parsing the logs into JSON. Thats quite valid for most of the cases, except when there is a error with a stack trace involved.

consola.setReporters([
  {
    log: (e) => {
      process.stderr.write( JSON.stringify(e) + "\n");
    },
  }
])

Then an empty object is returned in the args.

{"date":"2023-11-20T15:24:21.951Z","args":[{}],"type":"error","level":0,"tag":""}

Is there a chance where the error and the stack trace are included in the args ?

My final goal is to have json representation of the logs, without loosing data. Is there a way to do it ?

Env: NuxtJS 2.16
The stack trace is printed only with the BasicReporter and FancyReporter.
WinstonReporter is not working at all.
JsonReporter is printing empty object in a args.

Additional information

  • Would you be willing to help implement this feature?
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

No branches or pull requests

1 participant