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
# File 'lib/celluloid/internals/logger.rb', line 9

def debug(string)
  Celluloid.logger.debug(decorate(string)) if $CELLULOID_DEBUG
end

#decorate(string) ⇒ Object



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

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

#error(string) ⇒ Object



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

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

#info(string) ⇒ Object



13
14
15
# File 'lib/celluloid/internals/logger.rb', line 13

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

#warn(string) ⇒ Object



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

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