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

add emoji to log level name for iOS #108

Closed
wants to merge 1 commit into from

Conversation

king6cong
Copy link

because we can't tweak Xcode 8 to use color in console
robbiehanson/XcodeColors#88

@king6cong
Copy link
Author

image

@sfackler
Copy link
Member

This seems like something an individual logging implementation should do, not the base log crate. This will also break parsing since LOG_LEVEL_NAMES is used for that as well.

@king6cong
Copy link
Author

king6cong commented Apr 21, 2017

@sfackler Yeah, agree.

Do you think https://github.com/sfackler/log4rs/blob/master/src/encode/pattern/mod.rs#L553
will be a suitable place to handle this?

please also check this estk/log4rs#44 😄

because we can't tweak Xcode 8 to use color in console
emoji is a viable workaround, and log implementaion could
use this.
robbiehanson/XcodeColors#88
@king6cong
Copy link
Author

king6cong commented Apr 21, 2017

Updated, only add method to get emoji.
Not sure if this should be in this base log crate,
but I think it may be useful for multiple log implementations
Usage example like this:
estk/log4rs#45

@sfackler
Copy link
Member

How standard are these choices of emoji?

@king6cong
Copy link
Author

It is compatible with https://github.com/SwiftyBeaver/SwiftyBeaver

@dtolnay
Copy link
Member

dtolnay commented May 24, 2017

This doesn't need to be provided in log. I agree with @​sfackler that individual logging implementations can select emojis if they want.

As far as I can tell there isn't a standard but ❌⚠️ℹ️ is probably the most widely recognizable set and works way better in monochrome.

@dtolnay dtolnay closed this May 24, 2017
@ThuggishNuggets
Copy link

Just a heads up, if you use this in your logging in Xcode you'll get some pretty buggy behaviors trying to use debugger commands as well as some pretty serious performance hits on the logging since Xcode's console text layout engine doesn't seem to like rendering emoji with fixed width fonts.

One bug that's really annoying with this is the autocomplete menus keep flickering and disappearing when using emojis in logging statements.

We ended up removing them from our implementation it was so bad, but YMMV.

EFanZh pushed a commit to EFanZh/log that referenced this pull request Jul 23, 2023
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 this pull request may close these issues.

4 participants