packages feed

log-postgres 0.7.1.5 → 0.8.0.0

raw patch · 3 files changed

+10/−10 lines, 3 filesdep ~log-basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: log-base

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,6 @@+# log-postgres-0.8.0.0 (2021-06-09)+* Stop putting `insertion_time` and `insertion_order` in PostgreSQL.+ # log-postgres-0.7.1.5 (2021-05-28) * Support GHC 9.0. 
log-postgres.cabal view
@@ -1,6 +1,6 @@ cabal-version:       2.0 name:                log-postgres-version:             0.7.1.5+version:             0.8.0.0 synopsis:            Structured logging solution (PostgreSQL back end)  description:         PostgreSQL back end for the 'log' library suite.@@ -36,7 +36,7 @@                     , hpqtypes              >= 1.7                     , http-client           >= 0.5                     , lifted-base           >= 0.2-                    , log-base              >= 0.7  && < 0.10+                    , log-base              >= 0.10  && < 0.11                     , mtl                   >= 2.2                     , semigroups            >= 0.16                     , split                 >= 0.2
src/Log/Backend/PostgreSQL.hs view
@@ -51,18 +51,17 @@      sqlInsertLog :: SQL     sqlInsertLog = "INSERT INTO logs "-      <+> "(insertion_time, insertion_order, time, level, component,"-      <+> " domain, message, data) VALUES"+      <+> "(time, level, component, domain, message, data) VALUES"      serialize :: InvalidEncodingRecoveryAttempt -> [LogMessage] -> IO ()     serialize !attempt msgs = runDBT cs ts       (runSQL_ $ sqlInsertLog-       <+> mintercalate ", " (map sqlifyMessage $ zip [1..] msgs))+       <+> mintercalate ", " (map sqlifyMessage msgs))       `catches` [         -- Propagate base async exceptions thrown by the runtime system.         Handler $ \(e::AsyncException) -> throwIO e       , Handler $ \(e::SomeException) -> case fromException e of-        Just dbe@DBException{..}+        Just dbe@DBException{}           | Just qe <- getEncodingQueryError dbe -> case attempt of             Attempt 1 -> do               -- If a client uses UTF-8 encoding (TODO: in fact it should@@ -163,11 +162,9 @@         doValue (String s)   = String <$> doText s         doValue v            = return v -    sqlifyMessage :: (Int, LogMessage) -> SQL-    sqlifyMessage (n, LogMessage{..}) = mconcat [+    sqlifyMessage :: LogMessage -> SQL+    sqlifyMessage LogMessage{..} = mconcat [         "("-      , "now()"-      , "," <?> n       , "," <?> lmTime       , "," <?> showLogLevel lmLevel       , "," <?> lmComponent