tslog icon indicating copy to clipboard operation
tslog copied to clipboard

Bug: Only a few levels are printed in pretty mode

Open jakubhruby opened this issue 1 year ago • 6 comments

Describe the bug Only a few levels are printed in pretty mode. It's caused by broken _extend function, which ignores depth settings, therefore the hardcoded depth with value 2 is applied.

To Reproduce Try to log an object with 3+ depth - only 3 levels are pretty printed, the deeper levels are represented with [object Object] string https://codepen.io/jakubhruby/pen/OJYgzbR?editors=1111

Expected behavior Full depth object is printed.

Screenshots Snímek obrazovky z 2024-06-06 12-44-09

Here is the code which tries to assign opts (which includes dept: Infinite) to ctx, but it doesn't and ctx remains untouched. Below the default 2 is assigned to ctx.depth which limits output to three levels. image

jakubhruby avatar Jun 06 '24 10:06 jakubhruby

My fix was succesfully merge, but this later commit breaks it again https://github.com/fullstack-build/tslog/commits/v4.9.3/#diff-f37f417161a3f575bc97f812d0cc6c5da9a62f6fe5abbb342b4b2789ecad9ada

jakubhruby avatar Jun 10 '24 05:06 jakubhruby

Fix is ready...

jakubhruby avatar Jul 22 '24 05:07 jakubhruby

@terehov fix is ready

jakubhruby avatar Sep 10 '24 12:09 jakubhruby

Bumping this @terehov :) Having depth set to Infinity, or at least 5 or 10 would be great! Or a simpler way to set it via initialization options

kristianeboe avatar Oct 31 '24 01:10 kristianeboe

@jakubhruby could you potentially show how to solve this in the mean time using patch? https://bun.sh/docs/install/patch

I gave it a try, but wasn't able to accomplish what you did

kristianeboe avatar Oct 31 '24 01:10 kristianeboe

@terehov adjusting the depth option does nothing. Either with null or Infinity, or 10 image image

kristianeboe avatar Oct 31 '24 01:10 kristianeboe