Class: Halcyon::Logging::Logger

Inherits:
Logger
  • Object
show all
Defined in:
lib/halcyon/logging/logger.rb

Direct Known Subclasses

Logging

Class Method Summary collapse

Class Method Details

.setup(config) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/halcyon/logging/logger.rb', line 8

def setup(config)
  logger = config[:logger] || self.new(config[:file] || STDOUT)
  logger.formatter = proc{|s,t,p,m|"%5s [%s] (%s) %s :: %s\n" % [s, t.strftime("%Y-%m-%d %H:%M:%S"), $$, p, m]}
  logger.progname = Halcyon.app
  logger.level = Logger.const_get((config[:level] || 'info').upcase)
  logger
end