unjs / consola

🐨 Elegant Console Logger for Node.js and Browser
Other
6.12k stars 175 forks source link

Fancy reporter hides nested structures #73

Closed krzkaczor closed 1 year ago

krzkaczor commented 5 years ago

Version

v2.10.0

Reproduction link

https://repl.it/repls/RealDarkredOolanguage

Steps to reproduce

Create deeply (4 levels) nested object and try to log it.

What is expected ?

Whole object gets logged in the console.

What is actually happening?

Object is collapsed and part of it becomes simply [Object] hiding important info.

Additional comments?

This could be a configurable behaviour but I strongly belive that by default everything should be visible.

This bug report is available on Nuxt community (#c61)
dora-gt commented 4 years ago

I don't think this is a bug but I would like to specify a parameter like deep.

rasgo-cc commented 4 years ago

Related: https://github.com/nuxt-contrib/consola/commit/7ed640f399ca98de2bf1cf5e686343cfb6e2704a

The compact: false should expand the [Object] fields I assume.

Edit: You can actually pass a depth value. E.g.:

    new consola.FancyReporter({
            formatOptions: { colors: true, depth: 5 },
    }),

Available options: https://nodejs.org/api/util.html#util_util_inspect_object_options

pi0 commented 1 year ago

Consola v3 allows this via formatOptions top level.