Sha256: 8863513b417154487bcfde8a1c5b2e9064f4961f78bddc9b96ea94f99ff83d00

Contents?: true

Size: 479 Bytes

Versions: 7

Compression:

Stored size: 479 Bytes

Contents

# frozen_string_literal: true

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

    module ClassMethods
      def logger
        @logger ||= SlackRubyBotServer::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 & 1 rubygems

Version Path
slack-ruby-bot-server-2.1.1 lib/slack-ruby-bot-server/loggable.rb
slack-ruby-bot-server-2.1.0 lib/slack-ruby-bot-server/loggable.rb
slack-ruby-bot-server-2.0.1 lib/slack-ruby-bot-server/loggable.rb
slack-ruby-bot-server-1.2.1 lib/slack-ruby-bot-server/loggable.rb
slack-ruby-bot-server-1.2.0 lib/slack-ruby-bot-server/loggable.rb
slack-ruby-bot-server-1.1.0 lib/slack-ruby-bot-server/loggable.rb
slack-ruby-bot-server-1.0.0 lib/slack-ruby-bot-server/loggable.rb