Sha256: 211815476457d0b3d07fa3647ce77459a3d1f17a1cc569ff80063cd3dd234d48

Contents?: true

Size: 1.04 KB

Versions: 91

Compression:

Stored size: 1.04 KB

Contents

require 'logger'

module Concurrent
  module Concern

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

      # Logs through {Concurrent.global_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

91 entries across 85 versions & 22 rubygems

Version Path
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/concern/logging.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/concern/logging.rb
tdiary-5.0.11 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/logging.rb
sprokovuln-0.2.0 vendor/ruby/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/logging.rb
logstash-filter-device_detection-1.0.7-java vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/concern/logging.rb
tdiary-5.0.9 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/logging.rb
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/concern/logging.rb
monero_wallet_gen-0.1.0 vendor/bundle/ruby/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/logging.rb
tdiary-5.0.8 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/logging.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/logging.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/logging.rb
tdiary-5.0.7 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/logging.rb
pract6-0.1.0 .gem/ruby/2.3.0/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/logging.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/concurrent-ruby-1.0.0-java/lib/concurrent/concern/logging.rb
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/concurrent-ruby-1.0.0-java/lib/concurrent/concern/logging.rb
tdiary-5.0.6 vendor/bundle/gems/concurrent-ruby-1.0.5/lib/concurrent/concern/logging.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/concern/logging.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/concern/logging.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.5-java/lib/concurrent/concern/logging.rb
logstash-filter-cache-redis-0.1.0 vendor/bundle/jruby/1.9/gems/concurrent-ruby-1.0.0-java/lib/concurrent/concern/logging.rb