Sha256: 41bdb92f2281aec9fbba692e154cf21cc823e5f2b9e0fafed874a582823332e2

Contents?: true

Size: 528 Bytes

Versions: 5

Compression:

Stored size: 528 Bytes

Contents

# frozen_string_literal: true
module Raven
  class Logger
    LOG_PREFIX = "** [Raven] ".freeze

    [
      :fatal,
      :error,
      :warn,
      :info,
      :debug,
    ].each do |level|
      define_method level do |*args, &block|
        msg = args[0] # Block-level default args is a 1.9 feature
        msg ||= block.call if block
        logger = Raven.configuration[:logger]
        logger = ::Logger.new(STDOUT) if logger.nil?

        logger.send(level, "#{LOG_PREFIX}#{msg}") if logger
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sentry-raven-1.1.0 lib/raven/logger.rb
sentry-raven-1.0.0 lib/raven/logger.rb
sentry-raven-0.15.6 lib/raven/logger.rb
sentry-raven-0.15.5 lib/raven/logger.rb
sentry-raven-0.15.4 lib/raven/logger.rb