Sha256: 425e0ac2dbc0b56837eff77d7a3cf37832cce5e934c463e05105cac2a2445e41

Contents?: true

Size: 515 Bytes

Versions: 4

Compression:

Stored size: 515 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

4 entries across 4 versions & 1 rubygems

Version Path
bowline-0.5.3 lib/bowline/logging.rb
bowline-0.5.2 lib/bowline/logging.rb
bowline-0.5.1 lib/bowline/logging.rb
bowline-0.5.0 lib/bowline/logging.rb