packages feed

Blammo 1.0.0.1 → 1.0.1.1

raw patch · 3 files changed

+13/−3 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Network.Wai.Middleware.Logging: addThreadContextFromRequest :: (Request -> [Pair]) -> Middleware

Files

Blammo.cabal view
@@ -1,6 +1,6 @@ cabal-version:   1.18 name:            Blammo-version:         1.0.0.1+version:         1.0.1.1 license:         MIT license-file:    LICENSE maintainer:      Freckle Education
CHANGELOG.md view
@@ -1,5 +1,10 @@ ## [_Unreleased_](https://github.com/freckle/blammo/compare/v1.0.0.1...main) +## [v1.0.1.0](https://github.com/freckle/blammo/compare/v1.0.0.0...v1.0.1.0)++- Add `addThreadContextFromRequest`, a wai `Middleware` for adding context using+  information from the `Request`.+ ## [v1.0.0.1](https://github.com/freckle/blammo/compare/v1.0.0.0...v1.0.0.1)  - Relax lower bounds, support GHC 8.8
src/Network/Wai/Middleware/Logging.hs view
@@ -1,5 +1,6 @@ module Network.Wai.Middleware.Logging   ( addThreadContext+  , addThreadContextFromRequest   , requestLogger   ) where @@ -31,8 +32,12 @@  -- | Add context to any logging done from the request-handling thread addThreadContext :: [Pair] -> Middleware-addThreadContext context app request respond = do-  withThreadContext context $ do+addThreadContext = addThreadContextFromRequest . const++-- | 'addThreadContext', but have the 'Request' available+addThreadContextFromRequest :: (Request -> [Pair]) -> Middleware+addThreadContextFromRequest toContext app request respond = do+  withThreadContext (toContext request) $ do     app request respond  -- | Log requests (more accurately, responses) as they happen