Skip to content

console.error enhancement #4452

Closed
Closed
@DylanPiercey

Description

@DylanPiercey

I'm not sure exactly how this works and if this is the right place to raise the issue but:

In the browser (chrome)

console.error(new Error);

// Logs the error and an expandable stack trace.
Error()
    (anonymous function) @ VM297:2
    InjectedScript._evaluateOn @VM174:878
    InjectedScript._evaluateAndWrap @ VM174:811
    InjectedScript.evaluate @ VM174:667

In node:

console.error(new Error)
[Error]

// To properly show the stack trace I would have to console.error the stack.
// In the browser this causes the stack to be visible twice.
console.error((new Error).stack)

Is it possible to make it so that node will automatically add stack traces on console.error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    consoleIssues and PRs related to the console subsystem.feature requestIssues that request new features to be added to Node.js.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions