Module: Raptor::Log
- Defined in:
- lib/raptor/log.rb
Overview
Shared logging helpers. Every line is prefixed with ‘[Raptor <pid>|<ractor>|<thread>]` so output is identifiable and traceable to its source in a mixed log stream.
Class Method Summary collapse
-
.info(message) ⇒ void
Writes an informational message to stdout.
-
.rescued_error(error) ⇒ void
Logs a rescued exception to stderr.
-
.warn(message) ⇒ void
Writes a warning to stderr.
Class Method Details
.info(message) ⇒ void
This method returns an undefined value.
Writes an informational message to stdout.
16 17 18 |
# File 'lib/raptor/log.rb', line 16 def self.info() Kernel.puts "#{prefix} #{}" end |
.rescued_error(error) ⇒ void
This method returns an undefined value.
Logs a rescued exception to stderr. The full message (class, message, backtrace) is written on subsequent unprefixed lines.
37 38 39 40 |
# File 'lib/raptor/log.rb', line 37 def self.rescued_error(error) Kernel.warn "#{prefix} rescued:" Kernel.warn error. end |
.warn(message) ⇒ void
This method returns an undefined value.
Writes a warning to stderr.
26 27 28 |
# File 'lib/raptor/log.rb', line 26 def self.warn() Kernel.warn "#{prefix} #{}" end |