Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Only a few levels are printed in pretty mode #285

Open
jakubhruby opened this issue Jun 6, 2024 · 6 comments · Fixed by #286 · May be fixed by #293
Open

Bug: Only a few levels are printed in pretty mode #285

jakubhruby opened this issue Jun 6, 2024 · 6 comments · Fixed by #286 · May be fixed by #293
Labels
bug Something isn't working

Comments

@jakubhruby
Copy link
Contributor

jakubhruby commented Jun 6, 2024

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 jakubhruby added the bug Something isn't working label Jun 6, 2024
@jakubhruby
Copy link
Contributor Author

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 jakubhruby linked a pull request Jul 10, 2024 that will close this issue
@jakubhruby
Copy link
Contributor Author

Fix is ready...

@jakubhruby
Copy link
Contributor Author

@terehov fix is ready

@kristianeboe
Copy link

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
Copy link

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants