Skip to content

Instantly share code, notes, and snippets.

@Ji-Yuhang
Created May 24, 2016 07:21
Show Gist options
  • Save Ji-Yuhang/34d35ac97173610d37e730a98840f7eb to your computer and use it in GitHub Desktop.
Save Ji-Yuhang/34d35ac97173610d37e730a98840f7eb to your computer and use it in GitHub Desktop.
custom rails log by open class: ActiveSupport::Logger::SimpleFormatter
# 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