lib/slack/logger.rb in slack-ruby-client-0.14.4 vs lib/slack/logger.rb in slack-ruby-client-0.14.5
- old
+ new
@@ -1,13 +1,14 @@
+# frozen_string_literal: true
require 'logger'
module Slack
class Logger < ::Logger
def self.default
- @logger ||= begin
- logger = new STDOUT
- logger.level = Logger::WARN
- logger
- end
+ return @default if @default
+
+ logger = new STDOUT
+ logger.level = Logger::WARN
+ @default = logger
end
end
end