Sha256: ebb16dec19d23c793fd616556ad15c45e008a73ffd1a67bb4f2b65e41cbc71b0

Contents?: true

Size: 491 Bytes

Versions: 23

Compression:

Stored size: 491 Bytes

Contents

module Raven
  class Logger
    LOG_PREFIX = "** [Raven] "

    [
      :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

23 entries across 23 versions & 2 rubygems

Version Path
sentry-raven-0.9.1 lib/raven/logger.rb
sentry-raven-0.9.0 lib/raven/logger.rb
sentry-raven-0.8.0 lib/raven/logger.rb