Skip to content

Make console.log great again: better $inspect ergonomics #16998

@pngwn

Description

@pngwn

Describe the problem

I'm always frustrated when i use $inspect. The log shows the location as a svelte util (inspect.js) and there is no indication of the true source of the call.

I get extra frustrated when i think that $inspect.trace might be useful but then realise it is for something else.

I get double extra frustrated when i realise i need to write $inspect(val).with(console.trace). double extra because not only is it horrible to write but it gives me a full trace, hogging dozens of lines in my dev console.

i get super extra double frustrated when I realise I'm gonna need to write a helper for something that worked fine in v4 with $: console.log(val)

Describe the proposed solution

$inspect calls should show the file in which they were called, or a truncated stack trace.

Importance

would make my life easier

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions