Class: Celluloid::Logger::WithBacktrace

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

Instance Method Summary collapse

Constructor Details

#initialize(backtrace) ⇒ WithBacktrace

Returns a new instance of WithBacktrace.


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

def initialize(backtrace)
  @backtrace = backtrace
end

Instance Method Details

#debug(string) ⇒ Object


8
9
10
# File 'lib/celluloid/logger.rb', line 8

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

#decorate(string) ⇒ Object


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

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

#error(string) ⇒ Object


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

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

#info(string) ⇒ Object


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

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

#warn(string) ⇒ Object


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

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