Sha256: b1ea6ad3a12d3e9ba93d6fbbb71276e9830dc9758a4e30b988bb1b71d157a735

Contents?: true

Size: 621 Bytes

Versions: 23

Compression:

Stored size: 621 Bytes

Contents

module Pwwka
  module Logging

    delegate :fatal, :error, :warn, :info, :debug, to: :logger

    def logger
      Pwwka.configuration.logger
    end

    LEVELS = {
      fatal: 5,
      error: 4,
      warn: 3,
      info: 2,
      debug: 1,
    }

    def logf(format,params)
      level = params.delete(:at) || Pwwka.configuration.log_level
      params[:payload] = params["payload"] if params["payload"]
      if Pwwka.configuration.omit_payload_from_log?(level)
        params[:payload] = "[omitted]" if params[:payload]
      end
      message = format % params
      logger.send(level,message)
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
pwwka-0.23.0 lib/pwwka/logging.rb
pwwka-0.22.7 lib/pwwka/logging.rb
pwwka-0.22.7.RC lib/pwwka/logging.rb
pwwka-0.23.0.RC2 lib/pwwka/logging.rb
pwwka-0.22.6 lib/pwwka/logging.rb
pwwka-0.23.RC1 lib/pwwka/logging.rb
pwwka-0.22.5 lib/pwwka/logging.rb
pwwka-0.22.4 lib/pwwka/logging.rb
pwwka-0.22.3 lib/pwwka/logging.rb
pwwka-0.22.2 lib/pwwka/logging.rb
pwwka-0.21.3 lib/pwwka/logging.rb
pwwka-0.22.2.RC4 lib/pwwka/logging.rb
pwwka-0.22.2.RC3 lib/pwwka/logging.rb
pwwka-0.22.2.RC2 lib/pwwka/logging.rb
pwwka-0.22.0.RC2 lib/pwwka/logging.rb
pwwka-0.22.0.RC lib/pwwka/logging.rb
pwwka-0.21.2 lib/pwwka/logging.rb
pwwka-0.21.1 lib/pwwka/logging.rb
pwwka-0.21.0 lib/pwwka/logging.rb
pwwka-0.20.0 lib/pwwka/logging.rb