katip 0.8.7.4 → 0.8.8.0
raw patch · 4 files changed
+10/−5 lines, 4 filesdep +vectorPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: vector
API changes (from Hackage documentation)
- Katip: itemApp :: forall a_aaz8. Lens' (Item a_aaz8) Namespace
+ Katip: itemApp :: forall a_aasr. Lens' (Item a_aasr) Namespace
- Katip: itemEnv :: forall a_aaz8. Lens' (Item a_aaz8) Environment
+ Katip: itemEnv :: forall a_aasr. Lens' (Item a_aasr) Environment
- Katip: itemHost :: forall a_aaz8. Lens' (Item a_aaz8) HostName
+ Katip: itemHost :: forall a_aasr. Lens' (Item a_aasr) HostName
- Katip: itemLoc :: forall a_aaz8. Lens' (Item a_aaz8) (Maybe Loc)
+ Katip: itemLoc :: forall a_aasr. Lens' (Item a_aasr) (Maybe Loc)
- Katip: itemMessage :: forall a_aaz8. Lens' (Item a_aaz8) LogStr
+ Katip: itemMessage :: forall a_aasr. Lens' (Item a_aasr) LogStr
- Katip: itemNamespace :: forall a_aaz8. Lens' (Item a_aaz8) Namespace
+ Katip: itemNamespace :: forall a_aasr. Lens' (Item a_aasr) Namespace
- Katip: itemPayload :: forall a_aaz8 a_adUS. Lens (Item a_aaz8) (Item a_adUS) a_aaz8 a_adUS
+ Katip: itemPayload :: forall a_aasr a_adON. Lens (Item a_aasr) (Item a_adON) a_aasr a_adON
- Katip: itemProcess :: forall a_aaz8. Lens' (Item a_aaz8) ProcessID
+ Katip: itemProcess :: forall a_aasr. Lens' (Item a_aasr) ProcessID
- Katip: itemSeverity :: forall a_aaz8. Lens' (Item a_aaz8) Severity
+ Katip: itemSeverity :: forall a_aasr. Lens' (Item a_aasr) Severity
- Katip: itemThread :: forall a_aaz8. Lens' (Item a_aaz8) ThreadIdText
+ Katip: itemThread :: forall a_aasr. Lens' (Item a_aasr) ThreadIdText
- Katip: itemTime :: forall a_aaz8. Lens' (Item a_aaz8) UTCTime
+ Katip: itemTime :: forall a_aasr. Lens' (Item a_aasr) UTCTime
- Katip.Core: itemApp :: forall a_aaz8. Lens' (Item a_aaz8) Namespace
+ Katip.Core: itemApp :: forall a_aasr. Lens' (Item a_aasr) Namespace
- Katip.Core: itemEnv :: forall a_aaz8. Lens' (Item a_aaz8) Environment
+ Katip.Core: itemEnv :: forall a_aasr. Lens' (Item a_aasr) Environment
- Katip.Core: itemHost :: forall a_aaz8. Lens' (Item a_aaz8) HostName
+ Katip.Core: itemHost :: forall a_aasr. Lens' (Item a_aasr) HostName
- Katip.Core: itemLoc :: forall a_aaz8. Lens' (Item a_aaz8) (Maybe Loc)
+ Katip.Core: itemLoc :: forall a_aasr. Lens' (Item a_aasr) (Maybe Loc)
- Katip.Core: itemMessage :: forall a_aaz8. Lens' (Item a_aaz8) LogStr
+ Katip.Core: itemMessage :: forall a_aasr. Lens' (Item a_aasr) LogStr
- Katip.Core: itemNamespace :: forall a_aaz8. Lens' (Item a_aaz8) Namespace
+ Katip.Core: itemNamespace :: forall a_aasr. Lens' (Item a_aasr) Namespace
- Katip.Core: itemPayload :: forall a_aaz8 a_adUS. Lens (Item a_aaz8) (Item a_adUS) a_aaz8 a_adUS
+ Katip.Core: itemPayload :: forall a_aasr a_adON. Lens (Item a_aasr) (Item a_adON) a_aasr a_adON
- Katip.Core: itemProcess :: forall a_aaz8. Lens' (Item a_aaz8) ProcessID
+ Katip.Core: itemProcess :: forall a_aasr. Lens' (Item a_aasr) ProcessID
- Katip.Core: itemSeverity :: forall a_aaz8. Lens' (Item a_aaz8) Severity
+ Katip.Core: itemSeverity :: forall a_aasr. Lens' (Item a_aasr) Severity
- Katip.Core: itemThread :: forall a_aaz8. Lens' (Item a_aaz8) ThreadIdText
+ Katip.Core: itemThread :: forall a_aasr. Lens' (Item a_aasr) ThreadIdText
- Katip.Core: itemTime :: forall a_aaz8. Lens' (Item a_aaz8) UTCTime
+ Katip.Core: itemTime :: forall a_aasr. Lens' (Item a_aasr) UTCTime
Files
- changelog.md +4/−0
- katip.cabal +2/−1
- src/Katip/Scribes/Handle.hs +3/−1
- test/Katip/Tests/Scribes/Handle.hs +1/−3
changelog.md view
@@ -1,3 +1,7 @@+0.8.8.0+=======+* Add support for rendering arrays in the log context to the handle scribe [#150](https://github.com/Soostone/katip/pull/150)+ 0.8.7.4 ======= * Allow up to GHC 9.6 for Windows [#145](https://github.com/Soostone/katip/pull/145)
katip.cabal view
@@ -1,5 +1,5 @@ name: katip-version: 0.8.7.4+version: 0.8.8.0 synopsis: A structured logging framework. description: Katip is a structured logging framework. See README.md for more details.@@ -80,6 +80,7 @@ , semigroups , unliftio-core >= 0.1 , stm >= 2.4.4.1+ , vector hs-source-dirs: src default-language: Haskell2010
src/Katip/Scribes/Handle.hs view
@@ -16,10 +16,12 @@ import Data.Monoid as M import Data.Scientific as S import Data.Text (Text)+import qualified Data.Text as T import Data.Text.Lazy (toStrict) import Data.Text.Lazy.Builder import Data.Text.Lazy.Encoding (decodeUtf8) import Data.Text.Lazy.IO as T+import qualified Data.Vector as V ------------------------------------------------------------------------------- import Katip.Core import Katip.Format.Time (formatAsLogTime)@@ -53,11 +55,11 @@ renderPair (k, v) = case v of Object o -> concat [renderPair (k <> "." <> k', v') | (k', v') <- toTxtKeyList o]+ Array a -> concat [renderPair (k <> "." <> T.pack (show k'), v') | (k', v') <- V.toList (V.indexed a)] String t -> [fromText (k <> ":" <> t)] Number n -> [fromText (k <> ":") <> fromString (formatNumber n)] Bool b -> [fromText (k <> ":") <> fromString (show b)] Null -> [fromText (k <> ":null")]- _ -> mempty -- Can't think of a sensible way to handle arrays where formatNumber :: Scientific -> String formatNumber n =
test/Katip/Tests/Scribes/Handle.hs view
@@ -137,10 +137,8 @@ -- Following code tests Handle scribe output against a golden file. -- This test will fail on non utf8 locales because golden file is in utf-8.--- It generates all meaningfull variations of Item, and also tests+-- It generates all meaningful variations of Item, and also tests -- writing of payload of different Aeson constructors------ Note: currently Handle scribe does not write Array items at all ------------------------------------------------------------------------------- data AllTypesLogItem = AllTypesLogItem { atlText :: Text,