Class: DeepTest::Logger
- Inherits:
-
Logger
- Object
- Logger
- DeepTest::Logger
- Defined in:
- lib/deep_test/logger.rb
Instance Method Summary collapse
- #configured_log_level ⇒ Object
-
#initialize(*args) ⇒ Logger
constructor
A new instance of Logger.
- #io_stream ⇒ Object
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_level ⇒ Object
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_stream ⇒ Object
10 11 12 |
# File 'lib/deep_test/logger.rb', line 10 def io_stream @logdev.dev end |