Module: PUNK::Loggable

Extended by:
ActiveSupport::Concern
Included in:
App, Model, Service
Defined in:
lib/punk/helpers/loggable.rb

Instance Method Summary collapse

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.message,
      extra: extra,
      transaction: "Punk!"
    )
  end
  _clean(e)
  logger.error exception: e
end

#loggerObject



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