Skip to content

Instantly share code, notes, and snippets.

@a2f0
a2f0 / stats_logger.rb
Created March 26, 2019 01:48 — forked from LeZuse/stats_logger.rb
Puma plugin for stats logging on Heroku
Puma::Plugin.create do
def production?
ENV.fetch('RACK_ENV', 'development') == 'production'
end
def log(msg)
if production?
Rails.logger.info msg
else
puts msg