Class: Highlight::Logger

Inherits:
Logger
  • Object
show all
Includes:
ActiveSupport::LoggerSilence
Defined in:
lib/highlight.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Logger

Returns a new instance of Logger.



232
233
234
235
# File 'lib/highlight.rb', line 232

def initialize(*args)
  super
  @local_level = nil
end

Instance Method Details

#add(severity, message = nil, progname = nil, &block) ⇒ Object



237
238
239
240
241
242
243
244
245
246
247
# File 'lib/highlight.rb', line 237

def add(severity, message = nil, progname = nil, &block)
  severity ||= ::Logger::UNKNOWN
  return true if @logdev.nil? || severity < level

  progname ||= @progname
  message = yield if message.nil? && block_given?
  message = progname if message.nil?

  super
  H.instance&.record_log(nil, nil, severity, message)
end