Sha256: a619c1c971c3fff67f5e37677e560593aebeb7e7df61019e931b5f03a3d46af0

Contents?: true

Size: 516 Bytes

Versions: 3

Compression:

Stored size: 516 Bytes

Contents

module Bowline
  # To be included in classes to allow some basic logging.
  module Logging
    def trace(msg=nil)
      Bowline.logger.info(msg)
    end
    module_function :trace
    public :trace
    
    def debug(msg=nil)
      Bowline.logger.debug(msg)
    end
    module_function :debug
    public :debug
    
    # Log an error backtrace if debugging is activated
    def log_error(e=$!)
      debug "#{e}\n\t" + e.backtrace.join("\n\t")
    end
    module_function :log_error
    public :log_error
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bowline-0.5.6 lib/bowline/logging.rb
bowline-0.5.5 lib/bowline/logging.rb
bowline-0.5.4 lib/bowline/logging.rb