From be73d7d6c902a17961b02881b1e3b2448205c61d Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 7 Feb 2014 07:55:08 +0200 Subject: [PATCH] Scaffolding update --- yesod-bin/hsfiles/mongo.hsfiles | 13 +++++++------ yesod-bin/hsfiles/mysql.hsfiles | 13 +++++++------ yesod-bin/hsfiles/postgres-fay.hsfiles | 13 +++++++------ yesod-bin/hsfiles/postgres.hsfiles | 13 +++++++------ yesod-bin/hsfiles/simple.hsfiles | 13 +++++++------ yesod-bin/hsfiles/sqlite.hsfiles | 13 +++++++------ yesod-bin/yesod-bin.cabal | 2 +- 7 files changed, 43 insertions(+), 37 deletions(-) diff --git a/yesod-bin/hsfiles/mongo.hsfiles b/yesod-bin/hsfiles/mongo.hsfiles index 622a82a9..18d97553 100644 --- a/yesod-bin/hsfiles/mongo.hsfiles +++ b/yesod-bin/hsfiles/mongo.hsfiles @@ -54,7 +54,7 @@ mkYesodDispatch "App" resourcesApp -- performs initialization and creates a WAI application. This is also the -- place to put your migrate statements to have automatic database -- migrations handled by Yesod. -makeApplication :: AppConfig DefaultEnv Extra -> IO Application +makeApplication :: AppConfig DefaultEnv Extra -> IO (Application, LogFunc) makeApplication conf = do foundation <- makeFoundation conf @@ -69,7 +69,8 @@ makeApplication conf = do -- Create the WAI application and apply middlewares app <- toWaiAppPlain foundation - return $ logWare app + let logFunc = messageLoggerSource foundation (appLogger foundation) + return (logWare app, logFunc) -- | Loads up any necessary settings, creates your foundation datatype, and -- performs some initialization. @@ -103,7 +104,7 @@ makeFoundation conf = do -- for yesod devel getApplicationDev :: IO (Int, Application) getApplicationDev = - defaultDevelApp loader makeApplication + defaultDevelApp loader (fmap fst . makeApplication) where loader = Yesod.Default.Config.loadConfig (configSettings Development) { csParseExtra = parseExtra @@ -398,7 +399,7 @@ library DeriveDataTypeable build-depends: base >= 4 && < 5 - , yesod >= 1.2 && < 1.3 + , yesod >= 1.2.5 && < 1.3 , yesod-core >= 1.2 && < 1.3 , yesod-auth >= 1.2 && < 1.3 , yesod-static >= 1.2 && < 1.3 @@ -591,12 +592,12 @@ combineScripts = combineScripts' development combineSettings {-# START_FILE app/main.hs #-} import Prelude (IO) import Yesod.Default.Config (fromArgs) -import Yesod.Default.Main (defaultMain) +import Yesod.Default.Main (defaultMainLog) import Settings (parseExtra) import Application (makeApplication) main :: IO () -main = defaultMain (fromArgs parseExtra) makeApplication +main = defaultMainLog (fromArgs parseExtra) makeApplication {-# START_FILE BASE64 config/favicon.ico #-} AAABAAIAEBAAAAEAIABoBAAAJgAAABAQAgABAAEAsAAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAA diff --git a/yesod-bin/hsfiles/mysql.hsfiles b/yesod-bin/hsfiles/mysql.hsfiles index 535b71c7..56126df9 100644 --- a/yesod-bin/hsfiles/mysql.hsfiles +++ b/yesod-bin/hsfiles/mysql.hsfiles @@ -56,7 +56,7 @@ mkYesodDispatch "App" resourcesApp -- performs initialization and creates a WAI application. This is also the -- place to put your migrate statements to have automatic database -- migrations handled by Yesod. -makeApplication :: AppConfig DefaultEnv Extra -> IO Application +makeApplication :: AppConfig DefaultEnv Extra -> IO (Application, LogFunc) makeApplication conf = do foundation <- makeFoundation conf @@ -71,7 +71,8 @@ makeApplication conf = do -- Create the WAI application and apply middlewares app <- toWaiAppPlain foundation - return $ logWare app + let logFunc = messageLoggerSource foundation (appLogger foundation) + return (logWare app, logFunc) -- | Loads up any necessary settings, creates your foundation datatype, and -- performs some initialization. @@ -110,7 +111,7 @@ makeFoundation conf = do -- for yesod devel getApplicationDev :: IO (Int, Application) getApplicationDev = - defaultDevelApp loader makeApplication + defaultDevelApp loader (fmap fst . makeApplication) where loader = Yesod.Default.Config.loadConfig (configSettings Development) { csParseExtra = parseExtra @@ -402,7 +403,7 @@ library DeriveDataTypeable build-depends: base >= 4 && < 5 - , yesod >= 1.2 && < 1.3 + , yesod >= 1.2.5 && < 1.3 , yesod-core >= 1.2 && < 1.3 , yesod-auth >= 1.2 && < 1.3 , yesod-static >= 1.2 && < 1.3 @@ -595,12 +596,12 @@ combineScripts = combineScripts' development combineSettings {-# START_FILE app/main.hs #-} import Prelude (IO) import Yesod.Default.Config (fromArgs) -import Yesod.Default.Main (defaultMain) +import Yesod.Default.Main (defaultMainLog) import Settings (parseExtra) import Application (makeApplication) main :: IO () -main = defaultMain (fromArgs parseExtra) makeApplication +main = defaultMainLog (fromArgs parseExtra) makeApplication {-# START_FILE BASE64 config/favicon.ico #-} AAABAAIAEBAAAAEAIABoBAAAJgAAABAQAgABAAEAsAAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAA diff --git a/yesod-bin/hsfiles/postgres-fay.hsfiles b/yesod-bin/hsfiles/postgres-fay.hsfiles index 1f8acaee..4151f4fb 100644 --- a/yesod-bin/hsfiles/postgres-fay.hsfiles +++ b/yesod-bin/hsfiles/postgres-fay.hsfiles @@ -59,7 +59,7 @@ mkYesodDispatch "App" resourcesApp -- performs initialization and creates a WAI application. This is also the -- place to put your migrate statements to have automatic database -- migrations handled by Yesod. -makeApplication :: AppConfig DefaultEnv Extra -> IO Application +makeApplication :: AppConfig DefaultEnv Extra -> IO (Application, LogFunc) makeApplication conf = do foundation <- makeFoundation conf @@ -74,7 +74,8 @@ makeApplication conf = do -- Create the WAI application and apply middlewares app <- toWaiAppPlain foundation - return $ logWare app + let logFunc = messageLoggerSource foundation (appLogger foundation) + return (logWare app, logFunc) -- | Loads up any necessary settings, creates your foundation datatype, and -- performs some initialization. @@ -113,7 +114,7 @@ makeFoundation conf = do -- for yesod devel getApplicationDev :: IO (Int, Application) getApplicationDev = - defaultDevelApp loader makeApplication + defaultDevelApp loader (fmap fst . makeApplication) where loader = Yesod.Default.Config.loadConfig (configSettings Development) { csParseExtra = parseExtra @@ -438,7 +439,7 @@ library DeriveDataTypeable build-depends: base >= 4 && < 5 - , yesod >= 1.2 && < 1.3 + , yesod >= 1.2.5 && < 1.3 , yesod-core >= 1.2 && < 1.3 , yesod-auth >= 1.2 && < 1.3 , yesod-static >= 1.2 && < 1.3 @@ -644,12 +645,12 @@ combineScripts = combineScripts' development combineSettings {-# START_FILE app/main.hs #-} import Prelude (IO) import Yesod.Default.Config (fromArgs) -import Yesod.Default.Main (defaultMain) +import Yesod.Default.Main (defaultMainLog) import Settings (parseExtra) import Application (makeApplication) main :: IO () -main = defaultMain (fromArgs parseExtra) makeApplication +main = defaultMainLog (fromArgs parseExtra) makeApplication {-# START_FILE BASE64 config/favicon.ico #-} AAABAAIAEBAAAAEAIABoBAAAJgAAABAQAgABAAEAsAAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAA diff --git a/yesod-bin/hsfiles/postgres.hsfiles b/yesod-bin/hsfiles/postgres.hsfiles index 24d9ff38..2db6cd28 100644 --- a/yesod-bin/hsfiles/postgres.hsfiles +++ b/yesod-bin/hsfiles/postgres.hsfiles @@ -56,7 +56,7 @@ mkYesodDispatch "App" resourcesApp -- performs initialization and creates a WAI application. This is also the -- place to put your migrate statements to have automatic database -- migrations handled by Yesod. -makeApplication :: AppConfig DefaultEnv Extra -> IO Application +makeApplication :: AppConfig DefaultEnv Extra -> IO (Application, LogFunc) makeApplication conf = do foundation <- makeFoundation conf @@ -71,7 +71,8 @@ makeApplication conf = do -- Create the WAI application and apply middlewares app <- toWaiAppPlain foundation - return $ logWare app + let logFunc = messageLoggerSource foundation (appLogger foundation) + return (logWare app, logFunc) -- | Loads up any necessary settings, creates your foundation datatype, and -- performs some initialization. @@ -110,7 +111,7 @@ makeFoundation conf = do -- for yesod devel getApplicationDev :: IO (Int, Application) getApplicationDev = - defaultDevelApp loader makeApplication + defaultDevelApp loader (fmap fst . makeApplication) where loader = Yesod.Default.Config.loadConfig (configSettings Development) { csParseExtra = parseExtra @@ -402,7 +403,7 @@ library DeriveDataTypeable build-depends: base >= 4 && < 5 - , yesod >= 1.2 && < 1.3 + , yesod >= 1.2.5 && < 1.3 , yesod-core >= 1.2 && < 1.3 , yesod-auth >= 1.2 && < 1.3 , yesod-static >= 1.2 && < 1.3 @@ -595,12 +596,12 @@ combineScripts = combineScripts' development combineSettings {-# START_FILE app/main.hs #-} import Prelude (IO) import Yesod.Default.Config (fromArgs) -import Yesod.Default.Main (defaultMain) +import Yesod.Default.Main (defaultMainLog) import Settings (parseExtra) import Application (makeApplication) main :: IO () -main = defaultMain (fromArgs parseExtra) makeApplication +main = defaultMainLog (fromArgs parseExtra) makeApplication {-# START_FILE BASE64 config/favicon.ico #-} AAABAAIAEBAAAAEAIABoBAAAJgAAABAQAgABAAEAsAAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAA diff --git a/yesod-bin/hsfiles/simple.hsfiles b/yesod-bin/hsfiles/simple.hsfiles index 68f7f9cc..dd537b8c 100644 --- a/yesod-bin/hsfiles/simple.hsfiles +++ b/yesod-bin/hsfiles/simple.hsfiles @@ -51,7 +51,7 @@ mkYesodDispatch "App" resourcesApp -- performs initialization and creates a WAI application. This is also the -- place to put your migrate statements to have automatic database -- migrations handled by Yesod. -makeApplication :: AppConfig DefaultEnv Extra -> IO Application +makeApplication :: AppConfig DefaultEnv Extra -> IO (Application, LogFunc) makeApplication conf = do foundation <- makeFoundation conf @@ -66,7 +66,8 @@ makeApplication conf = do -- Create the WAI application and apply middlewares app <- toWaiAppPlain foundation - return $ logWare app + let logFunc = messageLoggerSource foundation (appLogger foundation) + return (logWare app, logFunc) -- | Loads up any necessary settings, creates your foundation datatype, and -- performs some initialization. @@ -96,7 +97,7 @@ makeFoundation conf = do -- for yesod devel getApplicationDev :: IO (Int, Application) getApplicationDev = - defaultDevelApp loader makeApplication + defaultDevelApp loader (fmap fst . makeApplication) where loader = Yesod.Default.Config.loadConfig (configSettings Development) { csParseExtra = parseExtra @@ -332,7 +333,7 @@ library DeriveDataTypeable build-depends: base >= 4 && < 5 - , yesod >= 1.2 && < 1.3 + , yesod >= 1.2.5 && < 1.3 , yesod-core >= 1.2 && < 1.3 , yesod-auth >= 1.2 && < 1.3 , yesod-static >= 1.2 && < 1.3 @@ -513,12 +514,12 @@ combineScripts = combineScripts' development combineSettings {-# START_FILE app/main.hs #-} import Prelude (IO) import Yesod.Default.Config (fromArgs) -import Yesod.Default.Main (defaultMain) +import Yesod.Default.Main (defaultMainLog) import Settings (parseExtra) import Application (makeApplication) main :: IO () -main = defaultMain (fromArgs parseExtra) makeApplication +main = defaultMainLog (fromArgs parseExtra) makeApplication {-# START_FILE BASE64 config/favicon.ico #-} AAABAAIAEBAAAAEAIABoBAAAJgAAABAQAgABAAEAsAAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAA diff --git a/yesod-bin/hsfiles/sqlite.hsfiles b/yesod-bin/hsfiles/sqlite.hsfiles index 7926323f..4255fa4b 100644 --- a/yesod-bin/hsfiles/sqlite.hsfiles +++ b/yesod-bin/hsfiles/sqlite.hsfiles @@ -56,7 +56,7 @@ mkYesodDispatch "App" resourcesApp -- performs initialization and creates a WAI application. This is also the -- place to put your migrate statements to have automatic database -- migrations handled by Yesod. -makeApplication :: AppConfig DefaultEnv Extra -> IO Application +makeApplication :: AppConfig DefaultEnv Extra -> IO (Application, LogFunc) makeApplication conf = do foundation <- makeFoundation conf @@ -71,7 +71,8 @@ makeApplication conf = do -- Create the WAI application and apply middlewares app <- toWaiAppPlain foundation - return $ logWare app + let logFunc = messageLoggerSource foundation (appLogger foundation) + return (logWare app, logFunc) -- | Loads up any necessary settings, creates your foundation datatype, and -- performs some initialization. @@ -110,7 +111,7 @@ makeFoundation conf = do -- for yesod devel getApplicationDev :: IO (Int, Application) getApplicationDev = - defaultDevelApp loader makeApplication + defaultDevelApp loader (fmap fst . makeApplication) where loader = Yesod.Default.Config.loadConfig (configSettings Development) { csParseExtra = parseExtra @@ -402,7 +403,7 @@ library DeriveDataTypeable build-depends: base >= 4 && < 5 - , yesod >= 1.2 && < 1.3 + , yesod >= 1.2.5 && < 1.3 , yesod-core >= 1.2 && < 1.3 , yesod-auth >= 1.2 && < 1.3 , yesod-static >= 1.2 && < 1.3 @@ -595,12 +596,12 @@ combineScripts = combineScripts' development combineSettings {-# START_FILE app/main.hs #-} import Prelude (IO) import Yesod.Default.Config (fromArgs) -import Yesod.Default.Main (defaultMain) +import Yesod.Default.Main (defaultMainLog) import Settings (parseExtra) import Application (makeApplication) main :: IO () -main = defaultMain (fromArgs parseExtra) makeApplication +main = defaultMainLog (fromArgs parseExtra) makeApplication {-# START_FILE BASE64 config/favicon.ico #-} AAABAAIAEBAAAAEAIABoBAAAJgAAABAQAgABAAEAsAAAAI4EAAAoAAAAEAAAACAAAAABACAAAAAA diff --git a/yesod-bin/yesod-bin.cabal b/yesod-bin/yesod-bin.cabal index 0abfd304..95fcfa2f 100644 --- a/yesod-bin/yesod-bin.cabal +++ b/yesod-bin/yesod-bin.cabal @@ -1,5 +1,5 @@ name: yesod-bin -version: 1.2.5.8 +version: 1.2.6 license: MIT license-file: LICENSE author: Michael Snoyman