unjs / consola

๐Ÿจ Elegant Console Logger for Node.js and Browser
Other
5.78k stars 165 forks source link

docs: add docs about raw method #271

Closed edimitchel closed 2 weeks ago

edimitchel commented 5 months ago

๐Ÿ”— Linked issue

Closes #268

โ“ Type of change

๐Ÿ“š Description

Add a chapter about the raw function to bypass potential bad interpretation from reporter.

๐Ÿ“ Checklist

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.

Project coverage is 28.11%. Comparing base (24c98ce) to head (5edf0ef). Report is 8 commits behind head on main.

Files Patch % Lines
examples/raw.ts 0.00% 9 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #271 +/- ## =========================================== - Coverage 61.08% 28.11% -32.97% =========================================== Files 13 41 +28 Lines 1380 2998 +1618 Branches 58 86 +28 =========================================== Hits 843 843 - Misses 537 2127 +1590 - Partials 0 28 +28 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Barbapapazes commented 5 months ago

Do you think you could add an example in ./examples?

pi0 commented 5 months ago

Thanks for helping document this feature. BTW keep note that it is an advanced feature I introduced back then as an escape hatch. We probably should consider it.

edimitchel commented 5 months ago

@pi0 to be honest, by writing the docs I wasn't feeling comfortable with the strange behavior of reporters when we are passing an object containing an args key..

edimitchel commented 5 months ago

I'm not fully confident by doing this documentation as raw method looks like a rescue patch to a potential issue of consola.

I'm wondering why consola permits those conflicts by passing args key? Couldn't we just prefix with an underscore to make virtually private?