Module: PSD::Logger::ClassMethods

Defined in:
lib/psd/logger.rb

Instance Attribute Summary collapse

Instance Attribute Details

#debugObject

Returns the value of attribute debug.



10
11
12
# File 'lib/psd/logger.rb', line 10

def debug
  @debug
end

#loggerObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/psd/logger.rb', line 18

def logger
  return @logger if @logger

  if debug || ENV['PSD_DEBUG']
    @logger = ::Logger.new(STDOUT)
    @logger.formatter = proc do |severity, datetime, progname, msg|
      "#{severity}: #{msg}\n"
    end
  else
    @logger = DisabledLogger.new
  end

  return @logger
end