Sha256: 497c76f43f9a525f59260be1ae59ce0293f4d7bb5acff30aa885d4b1181d08ac
Contents?: true
Size: 441 Bytes
Versions: 140
Compression:
Stored size: 441 Bytes
Contents
# frozen_string_literal: true require "logger" require "set" # Subclass of logger with method to only log a warning once # prevents the log from filling up with repeated messages. module Appsignal class Logger < ::Logger def seen_keys @seen_keys ||= Set.new end def warn_once_then_debug(key, message) if !seen_keys.add?(key).nil? warn message else debug message end end end end
Version data entries
140 entries across 140 versions & 1 rubygems