Sha256: 9dbb0dc34c71dbea7149fe2a2a7db28a531af87c6146b473103ed7fd9cf12bf4

Contents?: true

Size: 509 Bytes

Versions: 18

Compression:

Stored size: 509 Bytes

Contents

module Errdo
  class Logger

    include Errdo::Helpers::NotificationHelper

    def initialize(importance, *args)
      @importance = importance
      exception, string, params = separate_args(*args)
      @parser = Errdo::Models::ErrorLoggerParser.new(exception, string, params)
    end

    def log
      error = Errdo::Error.find_or_create(**@parser.error_hash, importance: @importance)
      error.try(:error_occurrences).try(:create, @parser.error_occurrence_hash)
      return error
    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
errdo-0.12.14 lib/errdo/logger.rb
errdo-0.12.13 lib/errdo/logger.rb
errdo-0.12.12 lib/errdo/logger.rb
errdo-0.12.11 lib/errdo/logger.rb
errdo-0.12.10 lib/errdo/logger.rb
errdo-0.12.9 lib/errdo/logger.rb
errdo-0.12.8 lib/errdo/logger.rb
errdo-0.12.7 lib/errdo/logger.rb
errdo-0.12.6 lib/errdo/logger.rb
errdo-0.12.5 lib/errdo/logger.rb
errdo-0.12.4 lib/errdo/logger.rb
errdo-0.12.3 lib/errdo/logger.rb
errdo-0.12.2 lib/errdo/logger.rb
errdo-0.12.1 lib/errdo/logger.rb
errdo-0.12.0 lib/errdo/logger.rb
errdo-0.11.6 lib/errdo/logger.rb
errdo-0.11.5 lib/errdo/logger.rb
errdo-0.11.4 lib/errdo/logger.rb