lumberjack 1.0.0.1 → 1.0.1.0
raw patch · 4 files changed
+33/−28 lines, 4 filesdep ~basedep ~exceptionsdep ~mtlPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, exceptions, mtl, text, time
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- LICENSE +1/−1
- lumberjack.cabal +7/−7
- src/Lumberjack.hs +21/−20
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for lumberjack +## 1.0.1.0 -- 2022-03-09++ * Update for GHC 9.2 (base-4.16-*) [thanks to Ryan Scott].+ ## 1.0.0.1 -- 2021-06-27 * Fix issue #2: use eta expansion example to avoid loss of deep
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2020 Galois Inc.+Copyright (c) 2020-2022 Galois Inc. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice
lumberjack.cabal view
@@ -1,6 +1,6 @@ cabal-version: >=1.10 name: lumberjack-version: 1.0.0.1+version: 1.0.1.0 synopsis: Trek through your code forest and make logs description: This is a logging facility. Yes, there are many, and this is the one with a beard, wearing flannel and boots, that gets the job done. It's@@ -35,7 +35,7 @@ license-file: LICENSE author: Kevin Quick maintainer: kquick@galois.com-copyright: 2020, Galois Inc.+copyright: 2020-2022, Galois Inc. category: Logging build-type: Simple extra-source-files: CHANGELOG.md@@ -47,14 +47,14 @@ library hs-source-dirs: src exposed-modules: Lumberjack- build-depends: base >= 4.11 && <4.16+ build-depends: base >= 4.11 && <4.17 , contravariant >= 1.5 && < 1.6- , exceptions >= 0.10.4 && < 0.11- , mtl >= 2.2.2 && < 2.3+ , exceptions+ , mtl , prettyprinter >= 1.6 && < 1.8 , prettyprinter-ansi-terminal >= 1.1.1.2 && < 1.2- , text >= 1.2.3.1 && < 1.3- , time >= 1.8 && < 1.10+ , text+ , time default-language: Haskell2010 executable example_log
src/Lumberjack.hs view
@@ -96,9 +96,9 @@ import Data.Text ( Text, pack, empty ) import qualified Data.Text as T import qualified Data.Text.IO as TIO-import qualified Data.Text.Prettyprint.Doc as PP-import qualified Data.Text.Prettyprint.Doc.Render.Terminal as PP_Term-import qualified Data.Text.Prettyprint.Doc.Render.Text as PP_Text+import qualified Prettyprinter as PP+import qualified Prettyprinter.Render.Terminal as PP_Term+import qualified Prettyprinter.Render.Text as PP_Text import Data.Time.Clock ( UTCTime(..), getCurrentTime, diffUTCTime ) import Data.Time.Format ( defaultTimeLocale, formatTime ) import Data.Void@@ -111,8 +111,8 @@ -- * Interface for Logging --- | The LogAction holds the ability to log a message of type 'msg'--- (the second parameter) via a monad 'm' (the first parameter).+-- | The LogAction holds the ability to log a message of type @msg@+-- (the second parameter) via a monad @m@ (the first parameter). -- -- LogActions are semigroup and monoid combineable, which results in -- both LogActions being taken (or no action in the case of mempty),@@ -150,8 +150,8 @@ -- | This type is a Constraint that should be applied to any client--- function that will perform logging in a monad context. The 'msg'--- is the type of message that will be logged, and the 'm' is the+-- function that will perform logging in a monad context. The @msg@+-- is the type of message that will be logged, and the @m@ is the -- monad under which the logging is performed. type WithLog msg m = ({- X.MonadCatch m, -} HasLog msg m) @@ -195,9 +195,9 @@ -- $richMsgType ----- This is an enhanced 'msg' type for the LogAction, containing+-- This is an enhanced message type for the LogAction, containing -- various auxiliary information associated with the log message.--- While 'Lumberjack' can be used with other message types, this+-- While "Lumberjack" can be used with other message types, this -- message type should provide support for most of the common logging -- auxiliary data and can therefore be used "out of the box". @@ -246,7 +246,7 @@ -- | This operator is a convenient infix operator for logging a Text -- message. This is especially useful when used in conjunction with--- the 'OverloadedStrings' language pragma:+-- the @OverloadedStrings@ language pragma: -- -- >>> warning|# "This is your last warning" -- >>> error|# "Failure has occurred"@@ -278,11 +278,11 @@ -- $richMsgFormatting ----- When the 'LogMessage' logging type is used, 'Lumberjack' provides a+-- When the 'LogMessage' logging type is used, "Lumberjack" provides a -- standard set of output formatting functions. The output uses the--- prettyprinter package to generate 'Doc' output with annotations--- specifying the type of markup to be applied to various portions of--- the output.+-- prettyprinter package to generate 'Prettyprinter.Doc' output with+-- annotations specifying the type of markup to be applied to various+-- portions of the output. -- -- There are multiple rendering functions that can be supplied as -- contramap converters to the base 'LogAction'. One rendering@@ -296,10 +296,10 @@ -- to different parts of the log message. This is achieved by calling -- 'prettyLogMessage'. ----- Alternatively, the 'Pretty' class 'pretty' method can be used to--- get log message formatting for generic annotation types, but the--- different parts of the message will not be distinguished via--- annotation values.+-- Alternatively, the 'Prettyprinter.Pretty' class @pretty@ method can+-- be used to get log message formatting for generic annotation types,+-- but the different parts of the message will not be distinguished+-- via annotation values. data PrettyLogAnn = AnnLogType LogType | AnnSeverity Severity | AnnTime@@ -369,8 +369,9 @@ -- | Format the log message with annotation values designating the -- different portions of the pretty-printed value. ----- The 'Pretty' class 'pretty' method can be used for generic--- annotations, but this yields less information for output management.+-- The 'Prettyprinter.Pretty' class @pretty@ method can be used for+-- generic annotations, but this yields less information for output+-- management. prettyLogMessage :: LogMessage -> PP.Doc PrettyLogAnn prettyLogMessage (LogMessage {..}) = PP.hsep [ prettyTime logTime , prettySev logLevel