Module: PUNK::Loggable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/punk/helpers/loggable.rb
Instance Method Summary collapse
- #exception(e, extra = {}) ⇒ Object
- #logger ⇒ Object
- #profile_debug(name, **kwargs, &block) ⇒ Object
- #profile_info(name, **kwargs, &block) ⇒ Object
- #profile_trace(name, **kwargs, &block) ⇒ Object
Instance Method Details
#exception(e, extra = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/punk/helpers/loggable.rb', line 23 def exception(e, extra={}) if ENV.key?('SENTRY_DSN') ::Raven.capture_exception( e, message: e., extra: extra, transaction: "Punk!" ) end _clean(e) logger.error exception: e end |
#logger ⇒ Object
7 8 9 |
# File 'lib/punk/helpers/loggable.rb', line 7 def logger self.class.logger end |
#profile_debug(name, **kwargs, &block) ⇒ Object
15 16 17 |
# File 'lib/punk/helpers/loggable.rb', line 15 def profile_debug(name, **kwargs, &block) self.class.profile_debug(name, **kwargs, &block) end |
#profile_info(name, **kwargs, &block) ⇒ Object
11 12 13 |
# File 'lib/punk/helpers/loggable.rb', line 11 def profile_info(name, **kwargs, &block) self.class.profile_info(name, **kwargs, &block) end |
#profile_trace(name, **kwargs, &block) ⇒ Object
19 20 21 |
# File 'lib/punk/helpers/loggable.rb', line 19 def profile_trace(name, **kwargs, &block) self.class.profile_trace(name, **kwargs, &block) end |