Class: Celluloid::Internals::Logger::WithBacktrace
- Inherits:
-
Object
- Object
- Celluloid::Internals::Logger::WithBacktrace
- Defined in:
- lib/celluloid/internals/logger.rb
Instance Method Summary collapse
- #debug(string) ⇒ Object
- #decorate(string) ⇒ Object
- #error(string) ⇒ Object
- #info(string) ⇒ Object
-
#initialize(backtrace) ⇒ WithBacktrace
constructor
A new instance of WithBacktrace.
- #warn(string) ⇒ Object
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 |