class Vara::Log
Public Class Methods
instance()
click to toggle source
# File lib/vara/log.rb, line 32 def instance @instance || raise('Logging attempted without being configured first!') end
stdout_mode!()
click to toggle source
# File lib/vara/log.rb, line 43 def stdout_mode! STDOUT.sync = true @instance = ::Logger.new(STDOUT) instance.sev_threshold = ::Logger.const_get(ENV.fetch('LOG_LEVEL', 'INFO')) end
test_mode!()
click to toggle source
# File lib/vara/log.rb, line 36 def test_mode! log_path = '/tmp/vara_test.log' File.open(log_path, 'w') {} # empty out the file in a cross-platform-safe way @instance = ::Logger.new(log_path, File::WRONLY | File::APPEND) instance.sev_threshold = ::Logger::DEBUG end