module Concurrent::Concern::Logging
def log(level, progname, message = nil, &block)
- Yieldreturn: - a message
Parameters:
-
message
(String, nil
) -- when nil block is used to generate the message -
progname
(String
) -- e.g. a path of an Actor -
level
(Integer
) -- one of Logger::Severity constants
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 = if defined?(@logger) && @logger @logger else Concurrent.global_logger end 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