packages feed

katip 0.5.0.0 → 0.5.0.1

raw patch · 4 files changed

+17/−7 lines, 4 filesdep +scientificdep ~aesondep ~template-haskelldep ~timePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: scientific

Dependency ranges changed: aeson, template-haskell, time

API changes (from Hackage documentation)

- Katip.Core: NewItem :: Item a -> WorkerMessage
- Katip.Core: PoisonPill :: WorkerMessage
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_0Environment
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_0Item
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_0LogStr
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_0Namespace
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_0Severity
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_0Verbosity
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_1Severity
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_1Verbosity
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_2Severity
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_2Verbosity
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_3Severity
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_3Verbosity
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_4Severity
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_5Severity
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_6Severity
- Katip.Core: instance GHC.Generics.Constructor Katip.Core.C1_7Severity
- Katip.Core: instance GHC.Generics.Datatype Katip.Core.D1Environment
- Katip.Core: instance GHC.Generics.Datatype Katip.Core.D1Item
- Katip.Core: instance GHC.Generics.Datatype Katip.Core.D1LogStr
- Katip.Core: instance GHC.Generics.Datatype Katip.Core.D1Namespace
- Katip.Core: instance GHC.Generics.Datatype Katip.Core.D1Severity
- Katip.Core: instance GHC.Generics.Datatype Katip.Core.D1Verbosity
- Katip.Core: instance GHC.Generics.Selector Katip.Core.S1_0_0Environment
- Katip.Core: instance GHC.Generics.Selector Katip.Core.S1_0_0Item
- Katip.Core: instance GHC.Generics.Selector Katip.Core.S1_0_0LogStr
- Katip.Core: instance GHC.Generics.Selector Katip.Core.S1_0_0Namespace
- Katip.Core: instance GHC.Generics.Selector Katip.Core.S1_0_10Item
- Katip.Core: instance GHC.Generics.Selector Katip.Core.S1_0_1Item
- Katip.Core: instance GHC.Generics.Selector Katip.Core.S1_0_2Item
- Katip.Core: instance GHC.Generics.Selector Katip.Core.S1_0_3Item
- Katip.Core: instance GHC.Generics.Selector Katip.Core.S1_0_4Item
- Katip.Core: instance GHC.Generics.Selector Katip.Core.S1_0_5Item
- Katip.Core: instance GHC.Generics.Selector Katip.Core.S1_0_6Item
- Katip.Core: instance GHC.Generics.Selector Katip.Core.S1_0_7Item
- Katip.Core: instance GHC.Generics.Selector Katip.Core.S1_0_8Item
- Katip.Core: instance GHC.Generics.Selector Katip.Core.S1_0_9Item
+ Katip.Core: [NewItem] :: LogItem a => Item a -> WorkerMessage
+ Katip.Core: [PoisonPill] :: WorkerMessage
- Katip: itemApp :: Lens' (Item a_an2a) Namespace
+ Katip: itemApp :: forall a_amYE. Lens' (Item a_amYE) Namespace
- Katip: itemEnv :: Lens' (Item a_an2a) Environment
+ Katip: itemEnv :: forall a_amYE. Lens' (Item a_amYE) Environment
- Katip: itemHost :: Lens' (Item a_an2a) HostName
+ Katip: itemHost :: forall a_amYE. Lens' (Item a_amYE) HostName
- Katip: itemLoc :: Lens' (Item a_an2a) (Maybe Loc)
+ Katip: itemLoc :: forall a_amYE. Lens' (Item a_amYE) (Maybe Loc)
- Katip: itemMessage :: Lens' (Item a_an2a) LogStr
+ Katip: itemMessage :: forall a_amYE. Lens' (Item a_amYE) LogStr
- Katip: itemNamespace :: Lens' (Item a_an2a) Namespace
+ Katip: itemNamespace :: forall a_amYE. Lens' (Item a_amYE) Namespace
- Katip: itemPayload :: Lens (Item a_an2a) (Item a_at2L) a_an2a a_at2L
+ Katip: itemPayload :: forall a_amYE a_aqgI. Lens (Item a_amYE) (Item a_aqgI) a_amYE a_aqgI
- Katip: itemProcess :: Lens' (Item a_an2a) ProcessID
+ Katip: itemProcess :: forall a_amYE. Lens' (Item a_amYE) ProcessID
- Katip: itemSeverity :: Lens' (Item a_an2a) Severity
+ Katip: itemSeverity :: forall a_amYE. Lens' (Item a_amYE) Severity
- Katip: itemThread :: Lens' (Item a_an2a) ThreadIdText
+ Katip: itemThread :: forall a_amYE. Lens' (Item a_amYE) ThreadIdText
- Katip: itemTime :: Lens' (Item a_an2a) UTCTime
+ Katip: itemTime :: forall a_amYE. Lens' (Item a_amYE) UTCTime
- Katip: toObject :: ToObject a => a -> Object
+ Katip: toObject :: (ToObject a, ToJSON a) => a -> Object
- Katip.Core: itemApp :: Lens' (Item a_an2a) Namespace
+ Katip.Core: itemApp :: forall a_amYE. Lens' (Item a_amYE) Namespace
- Katip.Core: itemEnv :: Lens' (Item a_an2a) Environment
+ Katip.Core: itemEnv :: forall a_amYE. Lens' (Item a_amYE) Environment
- Katip.Core: itemHost :: Lens' (Item a_an2a) HostName
+ Katip.Core: itemHost :: forall a_amYE. Lens' (Item a_amYE) HostName
- Katip.Core: itemLoc :: Lens' (Item a_an2a) (Maybe Loc)
+ Katip.Core: itemLoc :: forall a_amYE. Lens' (Item a_amYE) (Maybe Loc)
- Katip.Core: itemMessage :: Lens' (Item a_an2a) LogStr
+ Katip.Core: itemMessage :: forall a_amYE. Lens' (Item a_amYE) LogStr
- Katip.Core: itemNamespace :: Lens' (Item a_an2a) Namespace
+ Katip.Core: itemNamespace :: forall a_amYE. Lens' (Item a_amYE) Namespace
- Katip.Core: itemPayload :: Lens (Item a_an2a) (Item a_at2L) a_an2a a_at2L
+ Katip.Core: itemPayload :: forall a_amYE a_aqgI. Lens (Item a_amYE) (Item a_aqgI) a_amYE a_aqgI
- Katip.Core: itemProcess :: Lens' (Item a_an2a) ProcessID
+ Katip.Core: itemProcess :: forall a_amYE. Lens' (Item a_amYE) ProcessID
- Katip.Core: itemSeverity :: Lens' (Item a_an2a) Severity
+ Katip.Core: itemSeverity :: forall a_amYE. Lens' (Item a_amYE) Severity
- Katip.Core: itemThread :: Lens' (Item a_an2a) ThreadIdText
+ Katip.Core: itemThread :: forall a_amYE. Lens' (Item a_amYE) ThreadIdText
- Katip.Core: itemTime :: Lens' (Item a_an2a) UTCTime
+ Katip.Core: itemTime :: forall a_amYE. Lens' (Item a_amYE) UTCTime
- Katip.Core: toObject :: ToObject a => a -> Object
+ Katip.Core: toObject :: (ToObject a, ToJSON a) => a -> Object

Files

changelog.md view
@@ -1,3 +1,8 @@+0.5.0.1+=======+* Fix numeric formatting in Handle scribe.+* Bump deps for GHC 8.2.1+ 0.5.0.0 ======= * Improved documentation.
katip.cabal view
@@ -1,5 +1,5 @@ name:                katip-version:             0.5.0.0+version:             0.5.0.1 synopsis:            A structured logging framework. description:   Katip is a structured logging framework. See README.md for more details.@@ -54,7 +54,7 @@     OverloadedStrings    build-depends: base >=4.5 && <5-               , aeson >=0.6 && <1.2+               , aeson >=0.6 && <1.3                , async < 3.0.0.0                , auto-update >= 0.1 && < 0.2                , bytestring >= 0.9 && < 0.11@@ -64,9 +64,9 @@                , hostname >=1.0 && <1.1                , old-locale >= 1.0 && < 1.1                , string-conv >= 0.1 && < 0.2-               , template-haskell >= 2.8 && < 2.12+               , template-haskell >= 2.8 && < 2.13                , text >= 0.11 && <1.3-               , time >= 1 && < 1.7+               , time >= 1 && < 1.9                , transformers >= 0.3 && < 0.6                , transformers-compat                , unordered-containers >= 0.2 && < 0.3@@ -74,6 +74,7 @@                , mtl >= 2.0 && < 2.3                , transformers-base >= 0.3 && < 0.6                , resourcet >= 1.1 && < 1.2+               , scientific >= 0.3.3.0                , microlens >= 0.2.0.0 && < 0.5                , microlens-th >= 0.1.0.0 && < 0.5                , semigroups
src/Katip/Scribes/Handle.hs view
@@ -10,6 +10,7 @@ import           Data.Aeson import qualified Data.HashMap.Strict    as HM import           Data.Monoid+import           Data.Scientific        as S import           Data.Text              (Text) import           Data.Text.Lazy.Builder import           Data.Text.Lazy.IO      as T@@ -34,10 +35,13 @@       case v of         Object o -> concat [renderPair (k <> "." <> k', v')  | (k', v') <- HM.toList o]         String t -> [fromText (k <> ":" <> t)]-        Number n -> [fromText (k <> ":") <> fromString (show n)]+        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+    formatNumber :: Scientific -> String+    formatNumber n =+      formatScientific Generic (if isFloating n then Nothing else Just 0) n   -------------------------------------------------------------------------------
test/Katip/Tests/Scribes/Handle-text.golden view
@@ -36,5 +36,5 @@ [2016-06-12 12:34:56][foo][Info][example][7331][1337][note.deep:some note] message [2016-06-12 12:34:56][foo][Info][example][7331][1337][note.deep:some note][main:Some.Module path/Some/Module.hs:30:1] message [2016-06-12 12:34:56][foo][Info][example][7331][1337][note.deep:some note][main:Some.Module путь/Some/Module.hs:3000:9000] message-[2016-06-12 12:34:56][foo][Info][example][7331][1337][sub:null][text:][num:0.0][float:0.0] message-[2016-06-12 12:34:56][foo][Info][example][7331][1337][sub.note.deep:some note][text:note][num:10.0][float:5.5] message+[2016-06-12 12:34:56][foo][Info][example][7331][1337][sub:null][text:][num:0][float:0] message+[2016-06-12 12:34:56][foo][Info][example][7331][1337][sub.note.deep:some note][text:note][num:10][float:5.5] message