diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2013-05-16 11:47:01 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2013-05-16 11:47:01 +0100 |
commit | afdd78cae69c8fb549af7a4c8af5c8f282fcc403 (patch) | |
tree | 1ff0731669d2beebf8a03608c12bc5baefe74c3a | |
parent | e08051b78bae61dd42b48f4f8d9d086823ddbd2a (diff) |
Logging in tests can now be set using LOGLEVEL env variable.
-rw-r--r-- | test/th_mauve.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/th_mauve.rb b/test/th_mauve.rb index 4ec8dc5..49e714b 100644 --- a/test/th_mauve.rb +++ b/test/th_mauve.rb @@ -69,7 +69,14 @@ module Mauve @logger = Log4r::Logger.new 'Mauve' @outputter = Mauve::TestOutputter.new("test") @outputter.formatter = Log4r::PatternFormatter.new( :pattern => "%d %l %m" ) - @outputter.level = ($debug ? Log4r::DEBUG : Log4r::WARN) + @outputter.level = case ENV['LOGLEVEL'] + when "DEBUG" + Log4r::DEBUG + when "INFO" + Log4r::INFO + else + Log4r::WARN + end @logger.outputters << @outputter return @logger end |