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

Why normalize type and tag to lowercase? #189

Closed
jsonleex opened this issue May 14, 2023 · 3 comments · Fixed by #190
Closed

Why normalize type and tag to lowercase? #189

jsonleex opened this issue May 14, 2023 · 3 comments · Fixed by #190

Comments

@jsonleex
Copy link
Contributor

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.

consola/src/consola.ts

Lines 299 to 303 in 5619fc7

// Normalize type and tag to lowercase
logObj.type = (
typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log"
) as LogType;
logObj.tag = typeof logObj.tag === "string" ? logObj.tag.toLowerCase() : "";

@pi0
Copy link
Member

pi0 commented May 15, 2023

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

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

pi0 commented May 15, 2023

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

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

Successfully merging a pull request may close this issue.

2 participants