Created
May 24, 2016 07:21
-
-
Save Ji-Yuhang/34d35ac97173610d37e730a98840f7eb to your computer and use it in GitHub Desktop.
custom rails log by open class: ActiveSupport::Logger::SimpleFormatter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You can enable this feature by: LOGGER=crazy rails s | |
# File : config/initializers/logger.rb | |
if ENV["LOGGER"] == "crazy" | |
class ActiveSupport::Logger::SimpleFormatter | |
def call(severity, time, progname, msg) | |
"#{severity} #{time}: #{progname} #{caller.grep(/phoenix/)} -- : #{msg}\n" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment