Class: Testable::Logger

Inherits:
Object show all
Defined in:
lib/testable/logger.rb

Instance Method Summary collapse

Instance Method Details

#create(output = $stdout) ⇒ Object

Creates a logger instance with a predefined set of configuration options. This logger instance will be available to any portion of tests that are using the framework.



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

def create(output = $stdout)
  logger = ::Logger.new(output)
  logger.progname = 'Testable'
  logger.level = :UNKNOWN
  logger.formatter =
    proc do |severity, time, progname, msg|
      "#{time.strftime('%F %T')} - #{severity} - #{progname} - #{msg}\n"
    end

  logger
end