on master help sign in
Don't use a verbose logger when running tests
aa1762fJasper Van der Jeugt
src/Hakyll/Core/Configuration.hs+9−2
@@ -8,8 +8,12 @@ module Hakyll.Core.Configuration
8
8
9
9
10--------------------------------------------------------------------------------
10--------------------------------------------------------------------------------
11−import Data.List (isPrefixOf, isSuffixOf)
11+import Data.List (isPrefixOf, isSuffixOf)
12−import System.FilePath (takeFileName)
12+import System.FilePath (takeFileName)
13+
14+
15+--------------------------------------------------------------------------------
16+import Hakyll.Core.Logger
13
17
14
18
15--------------------------------------------------------------------------------
19--------------------------------------------------------------------------------
@@ -52,6 +56,8 @@ data Configuration = Configuration
52 , -- | Use an in-memory cache for items. This is faster but uses more
56 , -- | Use an in-memory cache for items. This is faster but uses more
53 -- memory.
57 -- memory.
54 inMemoryCache :: Bool
58 inMemoryCache :: Bool
59+ -- | Verbosity for the logger
60+ , verbosity :: Verbosity
55 }
61 }
56
62
57
63
@@ -65,6 +71,7 @@ defaultConfiguration = Configuration
65 , ignoreFile = ignoreFile'
71 , ignoreFile = ignoreFile'
66 , deployCommand = "echo 'No deploy command specified'"
72 , deployCommand = "echo 'No deploy command specified'"
67 , inMemoryCache = True
73 , inMemoryCache = True
74+ , verbosity = Message
68 }
75 }
69 where
76 where
70 ignoreFile' path
77 ignoreFile' path
src/Hakyll/Core/Runtime.hs+1−1
@@ -44,7 +44,7 @@ import Hakyll.Core.Writable
44run :: Configuration -> Rules a -> IO RuleSet
44run :: Configuration -> Rules a -> IO RuleSet
45run config rules = do
45run config rules = do
46 -- Initialization
46 -- Initialization
47− logger <- Logger.new Logger.Debug putStrLn
47+ logger <- Logger.new (verbosity config) putStrLn
48 Logger.header logger "Initialising..."
48 Logger.header logger "Initialising..."
49 Logger.message logger "Creating store..."
49 Logger.message logger "Creating store..."
50 store <- Store.new (inMemoryCache config) $ storeDirectory config
50 store <- Store.new (inMemoryCache config) $ storeDirectory config
tests/TestSuite/Util.hs+1
@@ -109,4 +109,5 @@ withTestConfiguration f = do
109 { destinationDirectory = "_testsite"
109 { destinationDirectory = "_testsite"
110 , storeDirectory = "_teststore"
110 , storeDirectory = "_teststore"
111 , providerDirectory = "tests/data"
111 , providerDirectory = "tests/data"
112+ , verbosity = Logger.Error
112 }
113 }