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

Instance Method Summary collapse

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