Sha256: 478f80062cf74e8ad0936d20dd3bdbedeb9a73457b93163e6db26fa1c0043810
Contents?: true
Size: 863 Bytes
Versions: 16
Compression:
Stored size: 863 Bytes
Contents
require 'logger' module Firehose # Sets up logging def self.logger @logger ||= Logger.new($stdout) end def self.logger=(logger) @logger = logger end self.logger.level = if ENV['LOG_LEVEL'] Logger.const_get(ENV['LOG_LEVEL'].upcase) else case ENV['RACK_ENV'] when 'test' then Logger::ERROR when 'development' then Logger::DEBUG else Logger::INFO end end # TODO: Provide some way to allow this to be configured via an ENV variable. self.logger.formatter = lambda do |severity, time, name, msg| out_time = time.utc.strftime "%Y-%m-%d %H:%M:%S.%L" "[#{out_time} ##$$] #{severity} : #{msg}\n" end end # stdout gets "lost" in Foreman if this isn't here # https://github.com/ddollar/foreman/wiki/Missing-Output $stdout.sync = true if ENV['RACK_ENV'] == 'development' || ENV['SYNC_LOGGING']
Version data entries
16 entries across 16 versions & 1 rubygems