Class: Pdsdk::Logger

Inherits:
Logger
  • Object
show all
Defined in:
lib/pdsdk/logger.rb

Constant Summary collapse

LOG_PREFIX =
"** [pdsdk] ".freeze
PROGNAME =
"pdsdk"

Instance Method Summary collapse

Constructor Details

#initializeLogger

Returns a new instance of Logger.



8
9
10
11
12
13
14
15
16
# File 'lib/pdsdk/logger.rb', line 8

def initialize(*)
  super
  @level = ::Logger::INFO
  original_formatter = ::Logger::Formatter.new
  @default_formatter = proc do |severity, datetime, _progname, msg|
    msg = "#{LOG_PREFIX}#{msg}"
    original_formatter.call(severity, datetime, PROGNAME, msg)
  end
end