lib/ditty/services/logger.rb in ditty-0.6.0 vs lib/ditty/services/logger.rb in ditty-0.7.0.pre.rc1
- old
+ new
@@ -7,10 +7,13 @@
require 'ditty/services/settings'
require 'active_support/core_ext/object/blank'
module Ditty
module Services
+ # This is the central logger for Ditty. It can be configured to log to
+ # multiple endpoints through Ditty Settings. The default configuration is to
+ # send logs to $stdout
class Logger
include Singleton
attr_reader :loggers
@@ -19,12 +22,10 @@
return if config[:loggers].blank?
config[:loggers].each do |values|
klass = values[:class].constantize
opts = tr(values[:options]) || nil
logger = klass.new(opts)
- if values[:level]
- logger.level = klass.const_get(values[:level].to_sym)
- end
+ logger.level = klass.const_get(values[:level].to_sym) if values[:level]
@loggers << logger
end
end
def method_missing(method, *args, &block)