Sha256: 0d7b04452f504629175ac7750c916c7d129037320384db7a089bc10f0715ac96

Contents?: true

Size: 436 Bytes

Versions: 6

Compression:

Stored size: 436 Bytes

Contents

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

6 entries across 6 versions & 1 rubygems

Version Path
slack-ruby-bot-0.12.0 lib/slack-ruby-bot/support/loggable.rb
slack-ruby-bot-0.11.2 lib/slack-ruby-bot/support/loggable.rb
slack-ruby-bot-0.11.1 lib/slack-ruby-bot/support/loggable.rb
slack-ruby-bot-0.11.0 lib/slack-ruby-bot/support/loggable.rb
slack-ruby-bot-0.10.5 lib/slack-ruby-bot/support/loggable.rb
slack-ruby-bot-0.10.4 lib/slack-ruby-bot/support/loggable.rb