Skip to content

Instantly share code, notes, and snippets.

@tokenvolt
Created February 6, 2014 19:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tokenvolt/8850823 to your computer and use it in GitHub Desktop.
Save tokenvolt/8850823 to your computer and use it in GitHub Desktop.
Sidekiq logger
Sidekiq.logger.formatter = proc do |severity, timestamp, context, message|
case severity
when 'INFO'
severity = severity.green
when 'ERROR'
severity = severity.red
else 'WARN'
severity = severity.yellow
end
"#{timestamp.utc.iso8601} #{Process.pid} TID-#{Thread.current.object_id.to_s(36)}#{context} #{severity}: #{message}\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment