lib/appium_lib/logger.rb in appium_lib-5.0.1 vs lib/appium_lib/logger.rb in appium_lib-6.0.0

- old
+ new

@@ -1,13 +1,25 @@ +require 'logger' + module Appium module Logger class << self extend Forwardable - def_delegators :@logger, :warn, :error, :info + def_delegators :logger, :ap, :fatal, :error, :warn, :info, :debug, :level, :level=, :formatter, :formatter= - # @private + [:fatal, :error, :warn, :info, :debug].each do |level| + define_method("ap_#{level}") {|obj| logger.ap(obj, level) } + end + + private + def logger - @logger ||= Logger.new + @logger ||= begin + logger = ::Logger.new($stdout) + logger.level = ::Logger::WARN + logger.formatter = proc { |severity, datetime, progname, msg| "#{msg}\n" } # do no special formatting + logger + end end end # class << self end # module Logger end # module Appium \ No newline at end of file