From afdd78cae69c8fb549af7a4c8af5c8f282fcc403 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Thu, 16 May 2013 11:47:01 +0100 Subject: Logging in tests can now be set using LOGLEVEL env variable. --- test/th_mauve.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'test/th_mauve.rb') 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 -- cgit v1.2.1