lib/logging/logger.rb in logging-0.9.8 vs lib/logging/logger.rb in logging-1.0.0

- old
+ new

@@ -10,12 +10,12 @@ # +Logger+ instances are obtained from the +Repository+ and should # not be directly created by users. # # Example: # - # log = Logging::Logger['my logger'] - # log.add_appenders( Logging::Appender.stdout ) # append to STDOUT + # log = Logging.logger['my logger'] + # log.add_appenders( Logging.appenders.stdout ) # append to STDOUT # log.level = :info # log 'info' and above # # log.info 'starting foo operation' # ... # log.info 'finishing foo operation' @@ -310,11 +310,11 @@ # Add the given _appenders_ to the list of appenders, where _appenders_ # can be either a single appender or an array of appenders. # def add_appenders( *args ) args.flatten.each do |arg| - o = arg.kind_of?(::Logging::Appender) ? arg : ::Logging::Appender[arg] - raise ArgumentError, "unknown appender '#{arg}'" if o.nil? + o = arg.kind_of?(::Logging::Appender) ? arg : ::Logging::Appenders[arg.to_s] + raise ArgumentError, "unknown appender #{arg.inspect}" if o.nil? @appenders << o unless @appenders.include?(o) end self end