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

Differentiate logs per Severity #183

Closed
mustafaozhan opened this issue Oct 29, 2021 · 9 comments
Closed

Differentiate logs per Severity #183

mustafaozhan opened this issue Oct 29, 2021 · 9 comments

Comments

@mustafaozhan
Copy link

mustafaozhan commented Oct 29, 2021

Android default logger is already giving us ability to set different colors for logs, so no problem there.

In Xcode unfortunately all logs are same color and if you are logging much stuff then it is hard to differentiate verbose, debug, warning...

It would be great to have the ability of setting colors for them if not possible then setting colorful icon in the tag like Napier does, please check the link.

@kpgalligan
Copy link
Collaborator

This is a great idea. I hate to lift ideas directly from another library, but I'll leave a comment I guess :)

@mustafaozhan
Copy link
Author

I am glad that you like it :) I am sure there will be limitation for coloring all the text if not the not sure how it will affect the performance.

Otherwise for the icon you are right it doesn't need to be same, well we can live with the dots also :)

Assert -> 🟣
Debug -> 🔵
Error -> 🔴
Info -> 🟢
Verbose -> ⚪
Warning -> 🟡

@kpgalligan
Copy link
Collaborator

I'm sitting here right now playing around with it. Basically the same idea, although slight differences
Screen Shot 2021-10-29 at 8 11 06 PM

@mustafaozhan
Copy link
Author

Hmm I think it would be better to have all dots to be consistent.

And about the colors not sure if there is some common practice about it. I basically shared from my android logchat theme, but After I looked internet for a bit I realised that they are all following the pattern that I send you.

Just puting below same order as your when block, this is how it looks like

Verbose -> ⚪
Debug -> 🔵
Info -> 🟢
Warning -> 🟡
Error -> 🔴
Assert -> 🟣

Some samples from random resources:
https://stackoverflow.com/a/39993868/8334146
https://stackoverflow.com/a/19951203/8334146
https://github.com/AAkira/Napier#android
https://newbedev.com/colored-logcat-in-android-studio-by-colorpid
https://www.titanwolf.org/Network/q/44765219-e0c3-42fe-a1ca-b9e4ea974e3c/y

@kpgalligan
Copy link
Collaborator

The issue I have is, in my mind, red is error, but assert is worse than error (and purple is for sure not worse than red, if we're talking severity). The defaults for Android Studio are reds for error and assert, and gray for everything else. The ones you've linked to are somebody's personal preference (I think?)

Anyway, I understand wanting consistency, and assert shouldn't exactly be common. There aren't many other circle options, but brown I think could be "worse" than red. I also moved green and blue, as "green, yellow, red" are traffic light signal colors, so info, warn, and error. I also changed verbose to white/gray instead of purple. Purple seemed to "stick out" more than a verbose line probably should.

Screen Shot 2021-10-30 at 10 46 45 AM

Anyway, that's the thought. At the end of the day, it's not that big of a deal in any case (and I made the fun open, so if somebody really wanted to dig in there...)

@mustafaozhan
Copy link
Author

The last one you shared works perfectly fine to me 🎉 Excited to see it in next releases 😍

@kpgalligan
Copy link
Collaborator

Output sample

Screen Shot 2021-10-30 at 2 35 40 PM

@mustafaozhan
Copy link
Author

It looks great 😍

@kpgalligan
Copy link
Collaborator

Closing. Currently available in 1.0.0-SNAPSHOT and will be 1.0.0 release.

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

No branches or pull requests

2 participants