handlebars.js icon indicating copy to clipboard operation
handlebars.js copied to clipboard

feat: log method support depth option

Open btea opened this issue 5 months ago • 0 comments

Before creating a pull-request, please check https://github.com/handlebars-lang/handlebars.js/blob/master/CONTRIBUTING.md first.

Generally we like to see pull requests that

  • [ ] Please don't start pull requests for security issues. Instead, file a report at https://www.npmjs.com/advisories/report?package=handlebars
  • [ ] Maintain the existing code style
  • [ ] Are focused on a single change (i.e. avoid large refactoring or style adjustments in untouched code if not the primary goal of the pull request)
  • [ ] Have good commit messages
  • [ ] Have tests
  • [ ] Have the typings (types/index.d.ts) updated on every API change. If you need help, updating those, please mention that in the PR description.
  • [ ] Don't significantly decrease the current code coverage (see coverage/lcov-report/index.html)
  • [ ] Currently, the 4.x-branch contains the latest version. Please target that branch in the PR.

In the nodejs environment, the default depth of objects printed by the console method is 2. Therefore, if you need to print out more levels of content in the object, you need to use the util.inspect method.

https://nodejs.org/api/util.html#utilinspectobject-showhidden-depth-colors

The log method currently supports level configuration. I would like to add a depth option so that more information can be clearly viewed when printing objects.

btea avatar Jul 22 '25 04:07 btea