Module: Rogu::Concern::Logging
- Includes:
- Logger::Severity
- Defined in:
- lib/rogu/concern/logging.rb
Overview
Enable logging where needed.
Modified version of the Concurrent::Concern::Logging module, without the timestamp field as it is automatically added by Heroku.
Instance Method Summary collapse
-
#log(level, progname, message = nil, &block) ⇒ Object
Logs through Concurrent.global_logger, it can be overridden by setting @logger.
Instance Method Details
#log(level, progname, message = nil, &block) ⇒ Object
Logs through Concurrent.global_logger, it can be overridden by setting @logger
18 19 20 21 22 23 24 25 |
# File 'lib/rogu/concern/logging.rb', line 18 def log(level, progname, = nil, &block) logger = ::Rogu.logger logger.call(level, progname, , &block) rescue => error $stderr.puts "`Rogu.logger` failed to log #{[level, progname, , block]}\n" + "#{error.} (#{error.class})\n#{error.backtrace.join "\n"}" end |