packages feed

log-postgres 0.8.0.2 → 0.8.1.0

raw patch · 3 files changed

+13/−9 lines, 3 filesdep ~aesondep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: aeson, base

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,8 @@+# log-postgres-0.8.1.0 (2022-04-04)+* Add support for aeson 2.0.1.0.+* Add support for GHC 9.2.+* Drop support for GHC < 8.8.+ # log-postgres-0.8.0.2 (2021-10-11) * Make compatible with log-base-0.11.0.0. 
log-postgres.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.0 name:                log-postgres-version:             0.8.0.2+version:             0.8.1.0 synopsis:            Structured logging solution (PostgreSQL back end)  description:         PostgreSQL back end for the 'log' library suite.@@ -18,8 +18,7 @@ category:            System build-type:          Simple extra-source-files:  CHANGELOG.md, README.md-tested-with:         GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.4-                      || ==9.0.1+tested-with:         GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.2  Source-repository head   Type:     git@@ -27,8 +26,8 @@  library   exposed-modules:    Log.Backend.PostgreSQL-  build-depends:      base                  >= 4.9  && < 5-                    , aeson                 >= 1.0 && < 1.6+  build-depends:      base                  >= 4.13  && < 5+                    , aeson                 >= 1.0                     , aeson-pretty          >= 0.8                     , base64-bytestring     >= 1.0                     , bytestring            >= 0.10
src/Log/Backend/PostgreSQL.hs view
@@ -14,7 +14,6 @@ import Prelude import qualified Data.ByteString.Base64 as B64 import qualified Data.Foldable as Foldable-import qualified Data.HashMap.Strict as H import qualified Data.Text as T import qualified Data.Text.Encoding as T import qualified Data.Vector as V@@ -22,6 +21,7 @@ import Log.Data import Log.Logger import Log.Internal.Logger+import qualified Log.Internal.Aeson.Compat as AC  newtype InvalidEncodingRecoveryAttempt = Attempt Int   deriving Enum@@ -116,7 +116,7 @@      addPair :: Value -> (T.Text, Value) -> Value     addPair data_ (name, value) = case data_ of-      Object obj -> Object $ H.insert name value obj+      Object obj -> Object $ AC.insert (AC.fromText name) value obj       _          -> object                     [ "_data" .= data_                     , "_log"  .= value@@ -156,8 +156,8 @@         doValue (Object obj) =           Object <$> Foldable.foldrM           (\(name, value) acc ->-             H.insert <$> doText name <*> doValue value <*> pure acc)-          H.empty (H.toList obj)+             AC.insert <$> AC.doName doText name <*> doValue value <*> pure acc)+          AC.empty (AC.toList obj)         doValue (Array arr)  = Array <$> V.mapM doValue arr         doValue (String s)   = String <$> doText s         doValue v            = return v