Class: Celluloid::Internals::Logger::WithBacktrace

Inherits:
Object
  • Object
show all
Defined in:
lib/celluloid/internals/logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(backtrace) ⇒ WithBacktrace

Returns a new instance of WithBacktrace.



5
6
7
# File 'lib/celluloid/internals/logger.rb', line 5

def initialize(backtrace)
  @backtrace = backtrace
end

Instance Method Details

#debug(string) ⇒ Object



9
10
11
12
13
14
# File 'lib/celluloid/internals/logger.rb', line 9

def debug(string)
  # !!! DO NOT INTRODUCE ADDITIONAL GLOBAL VARIABLES !!!
  # rubocop:disable Style/GlobalVars
  Celluloid.logger.debug(decorate(string)) if $CELLULOID_DEBUG
  # rubocop:enable Style/GlobalVars
end

#decorate(string) ⇒ Object



28
29
30
# File 'lib/celluloid/internals/logger.rb', line 28

def decorate(string)
  [string, @backtrace].join("\n\t")
end

#error(string) ⇒ Object



24
25
26
# File 'lib/celluloid/internals/logger.rb', line 24

def error(string)
  Celluloid.logger.error(decorate(string))
end

#info(string) ⇒ Object



16
17
18
# File 'lib/celluloid/internals/logger.rb', line 16

def info(string)
  Celluloid.logger.info(decorate(string))
end

#warn(string) ⇒ Object



20
21
22
# File 'lib/celluloid/internals/logger.rb', line 20

def warn(string)
  Celluloid.logger.warn(decorate(string))
end