Module: Bowline::Logging
- Included in:
- Desktop, Desktop::Bridge::Message, Desktop::JS::Script
- Defined in:
- lib/bowline/logging.rb
Overview
To be included in classes to allow some basic logging.
Class Method Summary collapse
- .debug(msg = nil) ⇒ Object
-
.log_error(e = $!) ⇒ Object
Log an error backtrace if debugging is activated.
- .trace(msg = nil) ⇒ Object
Instance Method Summary collapse
- #debug(msg = nil) ⇒ Object
-
#log_error(e = $!) ⇒ Object
Log an error backtrace if debugging is activated.
- #trace(msg = nil) ⇒ Object
Class Method Details
.debug(msg = nil) ⇒ Object
10 11 12 |
# File 'lib/bowline/logging.rb', line 10 def debug(msg=nil) Bowline.logger.debug(msg) end |
.log_error(e = $!) ⇒ Object
Log an error backtrace if debugging is activated
17 18 19 |
# File 'lib/bowline/logging.rb', line 17 def log_error(e=$!) Bowline.logger.error "#{e}\n\t" + e.backtrace.join("\n\t") end |
.trace(msg = nil) ⇒ Object
4 5 6 |
# File 'lib/bowline/logging.rb', line 4 def trace(msg=nil) Bowline.logger.info(msg) end |
Instance Method Details
#debug(msg = nil) ⇒ Object
10 11 12 |
# File 'lib/bowline/logging.rb', line 10 def debug(msg=nil) Bowline.logger.debug(msg) end |
#log_error(e = $!) ⇒ Object
Log an error backtrace if debugging is activated
17 18 19 |
# File 'lib/bowline/logging.rb', line 17 def log_error(e=$!) Bowline.logger.error "#{e}\n\t" + e.backtrace.join("\n\t") end |
#trace(msg = nil) ⇒ Object
4 5 6 |
# File 'lib/bowline/logging.rb', line 4 def trace(msg=nil) Bowline.logger.info(msg) end |