Sha256: 1e072afea72b8ba9874a0602f61541dbda446f44a8f754c6c2a9c55eaacc3e7c

Contents?: true

Size: 1.03 KB

Versions: 17

Compression:

Stored size: 1.03 KB

Contents

require 'logger'

module Concurrent
  module Concern

    # Include where logging is needed
    #
    # @!visibility private
    module Logging
      include Logger::Severity

      # Logs through {Configuration#logger}, it can be overridden by setting @logger
      # @param [Integer] level one of Logger::Severity constants
      # @param [String] progname e.g. a path of an Actor
      # @param [String, nil] message when nil block is used to generate the message
      # @yieldreturn [String] a message
      def log(level, progname, message = nil, &block)
        #NOTE: Cannot require 'concurrent/configuration' above due to circular references.
        #      Assume that the gem has been initialized if we've gotten this far.
        (@logger || Concurrent.global_logger).call level, progname, message, &block
      rescue => error
        $stderr.puts "`Concurrent.configuration.logger` failed to log #{[level, progname, message, block]}\n" +
          "#{error.message} (#{error.class})\n#{error.backtrace.join "\n"}"
      end
    end
  end
end

Version data entries

17 entries across 15 versions & 5 rubygems

Version Path
logstash-filter-zabbix-0.1.2 vendor/bundle/jruby/1.9/gems/concurrent-ruby-0.9.2-java/lib/concurrent/concern/logging.rb
logstash-filter-zabbix-0.1.1 vendor/bundle/jruby/1.9/gems/concurrent-ruby-0.9.2-java/lib/concurrent/concern/logging.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/concurrent-ruby-0.9.2-java/lib/concurrent/concern/logging.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/concurrent-ruby-0.9.2-java/lib/concurrent/concern/logging.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/concurrent-ruby-0.9.2-java/lib/concurrent/concern/logging.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/concurrent-ruby-0.9.2-java/lib/concurrent/concern/logging.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-codec-json-2.0.3/vendor/gems/concurrent-ruby-0.9.1-java/lib/concurrent/concern/logging.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/concurrent-ruby-0.9.1-java/lib/concurrent/concern/logging.rb
logstash-codec-json-2.0.3 vendor/gems/concurrent-ruby-0.9.1-java/lib/concurrent/concern/logging.rb
concurrent-ruby-0.9.2-java lib/concurrent/concern/logging.rb
concurrent-ruby-0.9.2 lib/concurrent/concern/logging.rb
logstash-input-beats-0.9.2 vendor/jruby/1.9/gems/concurrent-ruby-0.9.1-java/lib/concurrent/concern/logging.rb
logstash-input-beats-0.9.1 vendor/jruby/1.9/gems/concurrent-ruby-0.9.1-java/lib/concurrent/concern/logging.rb
concurrent-ruby-0.9.1 lib/concurrent/concern/logging.rb
concurrent-ruby-0.9.1-java lib/concurrent/concern/logging.rb
concurrent-ruby-0.9.0 lib/concurrent/concern/logging.rb
concurrent-ruby-0.9.0-java lib/concurrent/concern/logging.rb