yesod-core 1.4.11 → 1.4.11.1
raw patch · 3 files changed
+34/−15 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Yesod.Core: class RenderRoute site => Yesod site where approot = ApprootRelative errorHandler = defaultErrorHandler defaultLayout w = do { p <- widgetToPageContent w; mmsg <- getMessage; withUrlRenderer (\ _render_aIsg -> do { id ((preEscapedText . pack) "<!DOCTYPE html>\n\ \<html><head><style type="text/css">#synopsis details:not([open]) > ul { visibility: hidden; }</style><title>"); id (toHtml (pageTitle p)); id ((preEscapedText . pack) "</title>"); asHtmlUrl (pageHead p) _render_aIsg; id ((preEscapedText . pack) "</head><body>"); maybeH mmsg (\ msg_aIsh -> do { id ((preEscapedText . pack) "<p class=\"message\">"); id (toHtml msg_aIsh); id ((preEscapedText . pack) "</p>") }) Nothing; asHtmlUrl (pageBody p) _render_aIsg; id ((preEscapedText . pack) "</body></html>") }) } urlRenderOverride _ _ = Nothing isAuthorized _ _ = return Authorized isWriteRequest _ = do { wai <- waiRequest; return $ requestMethod wai `notElem` ["GET", "HEAD", "OPTIONS", "TRACE"] } authRoute _ = Nothing cleanPath _ s = if corrected == s then Right $ map dropDash s else Left corrected where corrected = filter (not . null) s dropDash t | all (== '-') t = drop 1 t | otherwise = t joinPath _ ar pieces' qs' = fromText ar `mappend` encodePath pieces qs where pieces = if null pieces' then [""] else map addDash pieces' qs = map (encodeUtf8 *** go) qs' go "" = Nothing go x = Just $ encodeUtf8 x addDash t | all (== '-') t = cons '-' t | otherwise = t addStaticContent _ _ _ = return Nothing maximumContentLength _ _ = Just $ 2 * 1024 * 1024 makeLogger _ = defaultMakeLogger messageLoggerSource site = defaultMessageLoggerSource $ shouldLogIO site jsLoader _ = BottomOfBody makeSessionBackend _ = fmap Just $ defaultClientSessionBackend 120 defaultKeyFile fileUpload _ (KnownLength size) | size <= 50000 = FileUploadMemory lbsBackEnd fileUpload _ _ = FileUploadDisk tempFileBackEnd shouldLog _ = defaultShouldLog shouldLogIO a b c = return (shouldLog a b c) yesodMiddleware = defaultYesodMiddleware yesodWithInternalState _ _ = bracket createInternalState closeInternalState
+ Yesod.Core: class RenderRoute site => Yesod site where approot = ApprootRelative errorHandler = defaultErrorHandler defaultLayout w = do { p <- widgetToPageContent w; mmsg <- getMessage; withUrlRenderer (\ _render_aIxB -> do { id ((preEscapedText . pack) "<!DOCTYPE html>\n\ \<html><head><style type="text/css">#synopsis details:not([open]) > ul { visibility: hidden; }</style><title>"); id (toHtml (pageTitle p)); id ((preEscapedText . pack) "</title>"); asHtmlUrl (pageHead p) _render_aIxB; id ((preEscapedText . pack) "</head><body>"); maybeH mmsg (\ msg_aIxC -> do { id ((preEscapedText . pack) "<p class=\"message\">"); id (toHtml msg_aIxC); id ((preEscapedText . pack) "</p>") }) Nothing; asHtmlUrl (pageBody p) _render_aIxB; id ((preEscapedText . pack) "</body></html>") }) } urlRenderOverride _ _ = Nothing isAuthorized _ _ = return Authorized isWriteRequest _ = do { wai <- waiRequest; return $ requestMethod wai `notElem` ["GET", "HEAD", "OPTIONS", "TRACE"] } authRoute _ = Nothing cleanPath _ s = if corrected == s then Right $ map dropDash s else Left corrected where corrected = filter (not . null) s dropDash t | all (== '-') t = drop 1 t | otherwise = t joinPath _ ar pieces' qs' = fromText ar `mappend` encodePath pieces qs where pieces = if null pieces' then [""] else map addDash pieces' qs = map (encodeUtf8 *** go) qs' go "" = Nothing go x = Just $ encodeUtf8 x addDash t | all (== '-') t = cons '-' t | otherwise = t addStaticContent _ _ _ = return Nothing maximumContentLength _ _ = Just $ 2 * 1024 * 1024 makeLogger _ = defaultMakeLogger messageLoggerSource site = defaultMessageLoggerSource $ shouldLogIO site jsLoader _ = BottomOfBody makeSessionBackend _ = fmap Just $ defaultClientSessionBackend 120 defaultKeyFile fileUpload _ (KnownLength size) | size <= 50000 = FileUploadMemory lbsBackEnd fileUpload _ _ = FileUploadDisk tempFileBackEnd shouldLog _ = defaultShouldLog shouldLogIO a b c = return (shouldLog a b c) yesodMiddleware = defaultYesodMiddleware yesodWithInternalState _ _ = bracket createInternalState closeInternalState
Files
- ChangeLog.md +8/−0
- Yesod/Core/Class/Yesod.hs +24/−13
- yesod-core.cabal +2/−2
ChangeLog.md view
@@ -1,3 +1,11 @@+## 1.4.12++* Don't show source location for logs that don't have that information [#1027](https://github.com/yesodweb/yesod/pull/1027)++## 1.4.11++* Expose `stripHandlerT` and `subHelper`+ ## 1.4.10 * Export log formatting [#1001](https://github.com/yesodweb/yesod/pull/1001)
Yesod/Core/Class/Yesod.hs view
@@ -615,7 +615,14 @@ Nothing -> Nothing Just j -> Just $ jelper j --- | Default formatting for log messages.+-- | Default formatting for log messages. When you use+-- the template haskell logging functions for to log with information+-- about the source location, that information will be appended to +-- the end of the log. When you use the non-TH logging functions, +-- like 'logDebugN', this function does not include source +-- information. This currently works by checking to see if the+-- package name is the string \"\<unknown\>\". This is a hack,+-- but it removes some of the visual clutter from non-TH logs. -- -- Since 1.4.10 formatLogMessage :: IO ZonedDate@@ -626,20 +633,24 @@ -> IO LogStr formatLogMessage getdate loc src level msg = do now <- getdate- return $- toLogStr now `mappend`- " [" `mappend`- (case level of+ return $ mempty+ `mappend` toLogStr now + `mappend` " [" + `mappend` (case level of LevelOther t -> toLogStr t- _ -> toLogStr $ drop 5 $ show level) `mappend`- (if T.null src+ _ -> toLogStr $ drop 5 $ show level) + `mappend` (if T.null src then mempty- else "#" `mappend` toLogStr src) `mappend`- "] " `mappend`- msg `mappend`- " @(" `mappend`- toLogStr (fileLocationToString loc) `mappend`- ")\n"+ else "#" `mappend` toLogStr src) + `mappend` "] " + `mappend` msg + `mappend` sourceSuffix+ `mappend` "\n"+ where + sourceSuffix = if loc_package loc == "<unknown>" then "" else mempty+ `mappend` " @(" + `mappend` toLogStr (fileLocationToString loc) + `mappend` ")" -- | Customize the cookies used by the session backend. You may -- use this function on your definition of 'makeSessionBackend'.
yesod-core.cabal view
@@ -1,5 +1,5 @@ name: yesod-core-version: 1.4.11+version: 1.4.11.1 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>@@ -47,7 +47,7 @@ , case-insensitive >= 0.2 , parsec >= 2 && < 3.2 , directory >= 1- , vector >= 0.9 && < 0.11+ , vector >= 0.9 && < 0.12 , aeson >= 0.5 , fast-logger >= 2.2 , wai-logger >= 0.2