Class: DeepTest::Logger

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

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Logger

Returns a new instance of Logger.



3
4
5
6
7
8
# File 'lib/deep_test/logger.rb', line 3

def initialize(*args)
  super
  hostname = Socket.gethostname
  self.formatter = proc { |severity, time, progname, msg| "[DeepTest@#{hostname}] #{time.strftime "%F %T"} #{msg}\n" }
  self.level = configured_log_level
end

Instance Method Details

#configured_log_levelObject



14
15
16
17
18
19
20
# File 'lib/deep_test/logger.rb', line 14

def configured_log_level
  if ENV['DEEP_TEST_LOG_LEVEL']
    Logger.const_get(ENV['DEEP_TEST_LOG_LEVEL'].upcase)
  else
    Logger::INFO
  end
end

#io_streamObject



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

def io_stream
  @logdev.dev
end