Commit a664325e authored by Iustin Pop's avatar Iustin Pop
Browse files

Reduce logging level in tests

This allows tests to execute IO actions which have logging as a side
effect, without polluting the stderr too much.

A better solution would be that we have fine-grained control over
loggers, so that tests can run with their own logging, etc. etc..
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarGuido Trotter <>
parent 55438c07
......@@ -28,6 +28,7 @@ module Main(main) where
import Data.Monoid (mappend)
import Test.Framework
import System.Environment (getArgs)
import System.Log.Logger
import Test.Ganeti.TestImports ()
import Test.Ganeti.Attoparsec
......@@ -120,4 +121,8 @@ main :: IO ()
main = do
ropts <- getArgs >>= interpretArgsOrExit
let opts = maybe defOpts (defOpts `mappend`) $ ropt_test_options ropts
-- silence the logging system, so that tests can execute I/O actions
-- which create logs without polluting stderr
-- FIXME: improve this by allowing tests to use logging if needed
updateGlobalLogger rootLoggerName (setLevel EMERGENCY)
defaultMainWithOpts allTests (ropts { ropt_test_options = Just opts })
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment