Open Autumnlight02 opened 1 year ago
so basically
import { inspect } from 'node:util';
inspect.defaultOptions.depth = Infinity;
does not work?
maybe this should be updated as well then
porting
Not work to me. (Bun 1.0.25, on MacOS)
It seems to be only one option at the moment:
console.log(JSON.stringify(deeplyNestedObject, null, 2)); // Specify '2' for the depth level
What I want with this is to have the same as bun's highlighted console.log output (for example booleans are yellow and strings are green) but at a higher depth. AFAIK, inspect doesn't give that, and JSON.stringify
certainly doesn't either.
What is the problem this feature would solve?
I sometimes have strongly nested Objects I need to debug, and when Bun console.logs showed an depth of 8, it was easier to work with.
What is the feature you are proposing to solve the problem?
Basically having a optional flag which can override the default console.log depth from 2 to a number between 1 to 8
What alternatives have you considered?
Technically JSON.stringify is a solution and porting it to a file but that slows things down