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

docs: add docs about raw method #271

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

edimitchel
Copy link

πŸ”— Linked issue

Closes #268

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

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

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

README.md Outdated Show resolved Hide resolved
@Barbapapazes Barbapapazes added the documentation Improvements or additions to documentation label Jan 9, 2024
Copy link

codecov bot commented Jan 9, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (9f7a22a) 61.13% compared to head (2b47072) 61.08%.
Report is 2 commits behind head on main.

❗ Current head 2b47072 differs from pull request most recent head d745fe3. Consider uploading reports for the commit d745fe3 to get more accurate results

Files Patch % Lines
src/utils/box.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #271      +/-   ##
==========================================
- Coverage   61.13%   61.08%   -0.05%     
==========================================
  Files          13       13              
  Lines        1379     1380       +1     
  Branches       58       58              
==========================================
  Hits          843      843              
- Misses        536      537       +1     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

Co-authored-by: EstΓ©ban <esteban.soubiran@insa-cvl.fr>
@Barbapapazes
Copy link
Member

Barbapapazes commented Jan 9, 2024

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

README.md Outdated
@@ -225,6 +225,18 @@ Log types are exposed as `consola.[type](...)` and each is a preset of styles an

A list of all available built-in types is [available here](./src/constants.ts).

## Raw output

Objects sent to reporter by logging them could be an issue when using conflicting key (esp. `args`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to add a link to isLogObj function, or add more description about conflicting keys, because conflicting keys are not so many, just a few.

Or, we could cover it in examples, as #271 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea to add a link to the isLogObj and we could add a note that this is an advanced feature.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this is what i am saying in comment bellow haha, to not go too deep, non of these internals are supposed to be documented as stable feature to use, nor are guaranteed to stay as is, that's why initially not documented ;)

@pi0
Copy link
Member

pi0 commented Jan 9, 2024

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

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

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: add explanation about LogObject and raw method
4 participants