unjs / consola

🐨 Elegant Console Logger for Node.js and Browser
Other
6k stars 175 forks source link

Why normalize `type` and `tag` to lowercase? #189

Closed jsonleex closed 1 year ago

jsonleex commented 1 year ago

Thank for making such a great tool.

This is not a bug. I'm just curious why we need to normalize type and tag to lowercase.

https://github.com/unjs/consola/blob/5619fc7cfb8eda48ce4471db625fab2bf39c1ad9/src/consola.ts#L299-L303

pi0 commented 1 year ago

Hi, and thanks for your kind words. It is just for output consistency in cli. Do you have a usecase that casing could matter?

jsonleex commented 1 year ago

Thanks for your reply.

example code:

consola.withTag('MyAppName').error('Something Wrong.')

I think the log should be [error] [MyAppName] Something Wrong., but I get [error] [myappname] Something Wrong.

Perhaps we should keep the custom input tag?

pi0 commented 1 year ago

Yeah makes sense. Feel free to open a PR for this change.