From 8b57ab509f9fbf7bb2058251beb60f39e8b476ca Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Mon, 21 Feb 2011 13:02:35 +0100 Subject: Add logger to Compiler monad --- src/Hakyll/Core/Compiler/Internal.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Hakyll/Core/Compiler') diff --git a/src/Hakyll/Core/Compiler/Internal.hs b/src/Hakyll/Core/Compiler/Internal.hs index a524a66..30a391f 100644 --- a/src/Hakyll/Core/Compiler/Internal.hs +++ b/src/Hakyll/Core/Compiler/Internal.hs @@ -26,6 +26,7 @@ import Hakyll.Core.Identifier import Hakyll.Core.ResourceProvider import Hakyll.Core.Store import Hakyll.Core.Routes +import Hakyll.Core.Logger -- | A set of dependencies -- @@ -44,6 +45,8 @@ data CompilerEnvironment = CompilerEnvironment compilerStore :: Store , -- | Flag indicating if the underlying resource was modified compilerResourceModified :: Bool + , -- | Logger + compilerLogger :: Logger } -- | The compiler monad @@ -91,8 +94,9 @@ runCompilerJob :: Compiler () a -- ^ Compiler to run -> Routes -- ^ Route -> Store -- ^ Store -> Bool -- ^ Was the resource modified? + -> Logger -- ^ Logger -> IO a -runCompilerJob compiler identifier provider route store modified = +runCompilerJob compiler identifier provider route store modified logger = runReaderT (unCompilerM $ compilerJob compiler ()) env where env = CompilerEnvironment @@ -101,6 +105,7 @@ runCompilerJob compiler identifier provider route store modified = , compilerRoutes = route , compilerStore = store , compilerResourceModified = modified + , compilerLogger = logger } runCompilerDependencies :: Compiler () a -- cgit v1.2.3