Class: Trackman::Utility::Debugger
- Inherits:
-
Object
- Object
- Trackman::Utility::Debugger
- Defined in:
- lib/trackman/utility/debugger.rb
Constant Summary collapse
- @@server_url =
ENV['TRACKMAN_URL']
Class Method Summary collapse
Class Method Details
.debug_mode? ⇒ Boolean
9 10 11 |
# File 'lib/trackman/utility/debugger.rb', line 9 def self.debug_mode? @@debug ||= ENV['TRACKMAN_DEBUG_MODE'] == 'true' end |
.log_exception(ex) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/trackman/utility/debugger.rb', line 17 def self.log_exception ex to_send = { :ruby_version => "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}", :gem_version => Trackman::VERSION, :rails_version => defined?(Rails) ? ::Rails::VERSION::STRING : 'rails not defined', :bundle => `bundle list`.split("\n"), :exception => { :class => ex.class.name, :message => ex., :backtrace => ex.backtrace }, :local => Trackman::Assets::Asset.all.map{|a| a.to_s }, :remote => Trackman::Assets::RemoteAsset.all.map{|a| a.to_s } } send_data to_send end |
.send_data(data) ⇒ Object
30 31 32 |
# File 'lib/trackman/utility/debugger.rb', line 30 def self.send_data data RestClient.post "#{@@server_url}/exceptions", data, :ssl_version => 'SSLv3' end |
.trace(data) ⇒ Object
13 14 15 |
# File 'lib/trackman/utility/debugger.rb', line 13 def self.trace data puts data if debug_mode? end |