Sha256: e637439ab236dd13c5e3f8cd87ec6b3fa7c8e9feca4972049b7e1102fa95ddae

Contents?: true

Size: 467 Bytes

Versions: 7

Compression:

Stored size: 467 Bytes

Contents

# frozen_string_literal: true

module SlackRubyBot
  module Loggable
    def self.included(base)
      base.send :include, InstanceMethods
      base.extend(ClassMethods)
    end

    module ClassMethods
      def logger
        @logger ||= SlackRubyBot::Config.logger || begin
          $stdout.sync = true
          Logger.new($stdout)
        end
      end
    end

    module InstanceMethods
      def logger
        self.class.logger
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
slackrb-0.17.1 lib/slack-ruby-bot/support/loggable.rb
slackrb-0.17.0 lib/slack-ruby-bot/support/loggable.rb
slack-ruby-bot-0.16.1 lib/slack-ruby-bot/support/loggable.rb
slack-ruby-bot-0.16.0 lib/slack-ruby-bot/support/loggable.rb
slack-ruby-bot-0.15.0 lib/slack-ruby-bot/support/loggable.rb
slack-ruby-bot-0.14.0 lib/slack-ruby-bot/support/loggable.rb
slack-ruby-bot-0.13.0 lib/slack-ruby-bot/support/loggable.rb