lib/review/logger.rb in review-3.2.0 vs lib/review/logger.rb in review-4.0.0
- old
+ new
@@ -1,20 +1,16 @@
require 'logger'
module ReVIEW
class Logger < ::Logger
- def initialize(*logdev)
- if logdev.empty?
- super(STDERR)
- self.formatter = ->(severity, _datetime, _progname, msg) { "#{severity}: #{msg}\n" }
- else
- super
- end
+ def initialize(io = STDERR, progname: '--')
+ super(io, progname: progname)
+ self.formatter = ->(severity, _datetime, name, msg) { "#{severity} #{name}: #{msg}\n" }
end
end
def self.logger
- @logger ||= ReVIEW::Logger.new
+ @logger ||= ReVIEW::Logger.new(STDERR, progname: File.basename($PROGRAM_NAME, '.*'))
end
def self.logger=(logger)
@logger = logger
end