-
Notifications
You must be signed in to change notification settings - Fork 117
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
Colorize logs in dev #894
Colorize logs in dev #894
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only include a freeze for a constant
and just only for fun you can use define_method
to create all repetitive methods
COLOR_CODES.keys.each do |level|
define_method(level) do |progname = nil, &block|
super(colorize(level, progname, &block))
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌈 🌈
Taken from https://gist.github.com/kyrylo/3d90f7a656d1a0accf244b8f1d25999b
Improves logs legibility by colorizing them by the log level
Another additional gem that may be worth adding (but requires more manual setup) is https://github.com/mechanicles/colorize_logs
BEFORE:
AFTER: