9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/halcyon/logging/log4r.rb', line 9
def setup(config)
logger = self.new(config[:label] || Halcyon.app)
if config[:file]
logger.outputters = Log4r::FileOutputter.new(:filename => config[:file])
else
logger.outputters = Log4r::Outputter.stdout
end
logger.level = Object.const_get((config[:level] || 'debug').upcase.to_sym)
logger.outputters[0].formatter = Log4r::PatternFormatter.new(:pattern => "%5l [%d] (#{$$}) #{Halcyon.app} :: %m\n", :date_pattern => "%Y-%m-%d %H:%M:%S")
logger
end
|