Module: Bellbro::Ringable
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(klass) ⇒ Object
3 4 5 |
# File 'lib/bellbro/ringable.rb', line 3 def self.included(klass) klass.extend(self) end |
Instance Method Details
#error(log_line) ⇒ Object
11 12 13 |
# File 'lib/bellbro/ringable.rb', line 11 def error(log_line) ring(log_line, type: :error) end |
#ring(log_line, opts = {}) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/bellbro/ringable.rb', line 15 def ring(log_line, opts={}) domain_insert = @domain ? "[#{@domain}]": "" error_insert = (opts[:type] == :error) ? "PlatformError " : "" complete_log_line = "[#{self.class}](#{Thread.current.object_id})#{domain_insert}: #{error_insert}#{log_line}" Bellbro::Settings.logger.info complete_log_line end |