Hello community, here is the log from the commit of package ghc-rio for openSUSE:Factory checked in at 2020-09-07 21:22:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-rio (Old) and /work/SRC/openSUSE:Factory/.ghc-rio.new.3399 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-rio" Mon Sep 7 21:22:16 2020 rev:15 rq:831223 version:0.1.18.0 Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-rio/ghc-rio.changes 2020-05-11 13:36:23.268492983 +0200 +++ /work/SRC/openSUSE:Factory/.ghc-rio.new.3399/ghc-rio.changes 2020-09-07 21:22:24.549024082 +0200 @@ -1,0 +2,27 @@ +Tue Sep 1 14:41:19 UTC 2020 - [email protected] + +- Update rio to version 0.1.18.0. + ## 0.1.18.0 + + * Add colours to the `LogOption` constructor [#222](https://github.com/commercialhaskell/rio/pull/222) + + ## 0.1.17.0 + + * Expose `Bifunctor`, `Bifoldable`, and `Bitraversable`. + * The `first` and `second` functions exported by `RIO` formerly originated from + `Control.Arrow`. They now come from `Bifunctor`. + + ## 0.1.16.0 + + * Expand the number of `microlens` functions exported by the RIO prelude. + * Add new module `RIO.Lens` which provides the rest of `microlens`. + + ## 0.1.15.1 + + * Replace `canonicalizePath` with `makeAbsolute` [#217](https://github.com/commercialhaskell/rio/issues/217) + + ## 0.1.15.0 + + * Include source in log messages + +------------------------------------------------------------------- Old: ---- rio-0.1.14.1.tar.gz New: ---- rio-0.1.18.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-rio.spec ++++++ --- /var/tmp/diff_new_pack.0Y1LaF/_old 2020-09-07 21:22:30.349026744 +0200 +++ /var/tmp/diff_new_pack.0Y1LaF/_new 2020-09-07 21:22:30.353026746 +0200 @@ -1,7 +1,7 @@ # # spec file for package ghc-rio # -# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,7 +19,7 @@ %global pkg_name rio %bcond_with tests Name: ghc-%{pkg_name} -Version: 0.1.14.1 +Version: 0.1.18.0 Release: 0 Summary: A standard library for Haskell License: MIT @@ -34,6 +34,7 @@ BuildRequires: ghc-filepath-devel BuildRequires: ghc-hashable-devel BuildRequires: ghc-microlens-devel +BuildRequires: ghc-microlens-mtl-devel BuildRequires: ghc-mtl-devel BuildRequires: ghc-primitive-devel BuildRequires: ghc-process-devel @@ -65,7 +66,7 @@ This package provides the Haskell %{pkg_name} library development files. %prep -%setup -q -n %{pkg_name}-%{version} +%autosetup -n %{pkg_name}-%{version} %build %ghc_lib_build ++++++ rio-0.1.14.1.tar.gz -> rio-0.1.18.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.14.1/ChangeLog.md new/rio-0.1.18.0/ChangeLog.md --- old/rio-0.1.14.1/ChangeLog.md 2020-03-01 10:03:13.000000000 +0100 +++ new/rio-0.1.18.0/ChangeLog.md 2020-08-05 05:33:41.000000000 +0200 @@ -1,5 +1,28 @@ # Changelog for rio +## 0.1.18.0 + +* Add colours to the `LogOption` constructor [#222](https://github.com/commercialhaskell/rio/pull/222) + +## 0.1.17.0 + +* Expose `Bifunctor`, `Bifoldable`, and `Bitraversable`. +* The `first` and `second` functions exported by `RIO` formerly originated from + `Control.Arrow`. They now come from `Bifunctor`. + +## 0.1.16.0 + +* Expand the number of `microlens` functions exported by the RIO prelude. +* Add new module `RIO.Lens` which provides the rest of `microlens`. + +## 0.1.15.1 + +* Replace `canonicalizePath` with `makeAbsolute` [#217](https://github.com/commercialhaskell/rio/issues/217) + +## 0.1.15.0 + +* Include source in log messages + ## 0.1.14.1 * Support `unliftio-core` 0.2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.14.1/rio.cabal new/rio-0.1.18.0/rio.cabal --- old/rio-0.1.14.1/rio.cabal 2020-03-01 10:03:36.000000000 +0100 +++ new/rio-0.1.18.0/rio.cabal 2020-08-05 05:35:52.000000000 +0200 @@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack -- --- hash: 6b5196ca703656226be396b57dc1cad657e697252fabe2a5da4c27bb45262263 +-- hash: 087056e2734e9ef4da6545d2654c71c939cf6f9a04aac90c5427c43597cb8b88 name: rio -version: 0.1.14.1 +version: 0.1.18.0 synopsis: A standard library for Haskell description: See README and Haddocks at <https://www.stackage.org/package/rio> category: Control @@ -42,6 +42,7 @@ RIO.HashMap RIO.HashMap.Partial RIO.HashSet + RIO.Lens RIO.List RIO.List.Partial RIO.Map @@ -102,6 +103,7 @@ , filepath , hashable , microlens + , microlens-mtl , mtl , primitive , process @@ -150,6 +152,7 @@ , hashable , hspec , microlens + , microlens-mtl , mtl , primitive , process diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.14.1/src/RIO/Lens.hs new/rio-0.1.18.0/src/RIO/Lens.hs --- old/rio-0.1.14.1/src/RIO/Lens.hs 1970-01-01 01:00:00.000000000 +0100 +++ new/rio-0.1.18.0/src/RIO/Lens.hs 2020-08-05 05:24:55.000000000 +0200 @@ -0,0 +1,39 @@ +-- | +-- Module : RIO.Lens +-- License : MIT +-- Maintainer: Colin Woodbury <[email protected]> +-- +-- Extra utilities from @microlens@. +-- +-- @since: 0.1.16.0 +module RIO.Lens + ( -- * Fold + SimpleFold + , toListOf + , has + -- * Lens + , _1, _2, _3, _4, _5 + , at + , lens + -- * Iso + , non + -- * Traversal + , singular + , failing + , filtered + , both + , traversed + , each + , ix + , _head + , _tail + , _init + , _last + -- * Prism + , _Left + , _Right + , _Just + , _Nothing + ) where + +import Lens.Micro diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.14.1/src/RIO/Prelude/Lens.hs new/rio-0.1.18.0/src/RIO/Prelude/Lens.hs --- old/rio-0.1.14.1/src/RIO/Prelude/Lens.hs 2020-03-01 09:23:42.000000000 +0100 +++ new/rio-0.1.18.0/src/RIO/Prelude/Lens.hs 2020-08-05 05:24:55.000000000 +0200 @@ -1,5 +1,6 @@ module RIO.Prelude.Lens ( view + , preview , Lens.Micro.ASetter , Lens.Micro.ASetter' , Lens.Micro.Getting @@ -12,12 +13,11 @@ , Lens.Micro.sets , Lens.Micro.to , (Lens.Micro.^.) + , (Lens.Micro.^?) + , (Lens.Micro.^..) + , (Lens.Micro.%~) + , (Lens.Micro..~) ) where import Lens.Micro -import Control.Monad.Reader (MonadReader, asks) -import Lens.Micro.Internal (( #. )) -import Control.Applicative (Const (..)) - -view :: MonadReader s m => Getting a s a -> m a -view l = asks (getConst #. l Const) +import Lens.Micro.Mtl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.14.1/src/RIO/Prelude/Logger.hs new/rio-0.1.18.0/src/RIO/Prelude/Logger.hs --- old/rio-0.1.14.1/src/RIO/Prelude/Logger.hs 2020-03-01 09:23:42.000000000 +0100 +++ new/rio-0.1.18.0/src/RIO/Prelude/Logger.hs 2020-08-05 05:24:55.000000000 +0200 @@ -24,6 +24,9 @@ , setLogUseColor , setLogUseLoc , setLogFormat + , setLogLevelColors + , setLogSecondaryColor + , setLogAccentColors -- ** Standard logging functions , logDebug , logInfo @@ -35,6 +38,8 @@ , logSticky , logStickyDone -- *** With source + -- + -- $withSource , logDebugS , logInfoS , logWarnS @@ -54,6 +59,9 @@ , noLogging -- ** Accessors , logFuncUseColorL + , logFuncLogLevelColorsL + , logFuncSecondaryColorL + , logFuncAccentColorsL -- * Type-generic logger -- $type-generic-intro , glog @@ -204,6 +212,17 @@ -> m () logOther = logGeneric "" . LevelOther +-- $withSource +-- +-- There is a set of logging functions that take an extra 'LogSource' +-- argument to provide context, typically detailing what part of an +-- application the message comes from. +-- +-- For example, in verbose mode, @infoLogS "database" "connected"@ will +-- result in +-- +-- > [info] (database) connected + -- | Log a debug level message with the given source. -- -- @since 0.0.0.0 @@ -306,6 +325,7 @@ , logTerminal = True , logUseTime = False , logUseColor = False + , logColors = defaultLogColors , logUseLoc = False , logFormat = id , logSend = \new -> atomicModifyIORef' ref $ \old -> (old <> new, ()) @@ -344,6 +364,7 @@ #else , logUseColor = verbose && terminal #endif + , logColors = defaultLogColors , logUseLoc = verbose , logFormat = id , logSend = \builder -> @@ -446,11 +467,45 @@ , logTerminal :: !Bool , logUseTime :: !Bool , logUseColor :: !Bool + , logColors :: !LogColors , logUseLoc :: !Bool , logFormat :: !(Utf8Builder -> Utf8Builder) , logSend :: !(Builder -> IO ()) } +-- | ANSI color codes for use in the configuration of the creation of a +-- 'LogFunc'. +-- +-- @since 0.1.18.0 +data LogColors = LogColors + { -- | The color associated with each 'LogLevel'. + logColorLogLevels :: !(LogLevel -> Utf8Builder) + -- | The color of secondary content. + , logColorSecondary :: !Utf8Builder + -- | The color of accents, which are indexed by 'Int'. + , logColorAccents :: !(Int -> Utf8Builder) + } + +defaultLogColors :: LogColors +defaultLogColors = LogColors + { logColorLogLevels = defaultLogLevelColors + , logColorSecondary = defaultLogSecondaryColor + , logColorAccents = defaultLogAccentColors + } + +defaultLogLevelColors :: LogLevel -> Utf8Builder +defaultLogLevelColors LevelDebug = "\ESC[32m" -- Green +defaultLogLevelColors LevelInfo = "\ESC[34m" -- Blue +defaultLogLevelColors LevelWarn = "\ESC[33m" -- Yellow +defaultLogLevelColors LevelError = "\ESC[31m" -- Red +defaultLogLevelColors (LevelOther _) = "\ESC[35m" -- Magenta + +defaultLogSecondaryColor :: Utf8Builder +defaultLogSecondaryColor = "\ESC[90m" -- Bright black (gray) + +defaultLogAccentColors :: Int -> Utf8Builder +defaultLogAccentColors = const "\ESC[92m" -- Bright green + -- | Set the minimum log level. Messages below this level will not be -- printed. -- @@ -513,6 +568,44 @@ setLogUseColor :: Bool -> LogOptions -> LogOptions setLogUseColor c options = options { logUseColor = c } +-- | ANSI color codes for 'LogLevel' in the log output. +-- +-- Default: 'LevelDebug' = \"\\ESC[32m\" -- Green +-- 'LevelInfo' = \"\\ESC[34m\" -- Blue +-- 'LevelWarn' = \"\\ESC[33m\" -- Yellow +-- 'LevelError' = \"\\ESC[31m\" -- Red +-- 'LevelOther' _ = \"\\ESC[35m\" -- Magenta +-- +-- @since 0.1.18.0 +setLogLevelColors :: (LogLevel -> Utf8Builder) -> LogOptions -> LogOptions +setLogLevelColors logLevelColors options = + let lc = (logColors options){ logColorLogLevels = logLevelColors } + in options { logColors = lc } + +-- | ANSI color codes for secondary content in the log output. +-- +-- Default: \"\\ESC[90m\" -- Bright black (gray) +-- +-- @since 0.1.18.0 +setLogSecondaryColor :: Utf8Builder -> LogOptions -> LogOptions +setLogSecondaryColor c options = + let lc = (logColors options){ logColorSecondary = c } + in options { logColors = lc } + +-- | ANSI color codes for accents in the log output. Accent colors are indexed +-- by 'Int'. +-- +-- Default: 'const' \"\\ESC[92m\" -- Bright green, for all indicies +-- +-- @since 0.1.18.0 +setLogAccentColors + :: (Int -> Utf8Builder) -- ^ This should be a total function. + -> LogOptions + -> LogOptions +setLogAccentColors accentColors options = + let lc = (logColors options){ logColorAccents = accentColors } + in options { logColors = lc } + -- | Use code location in the log output. -- -- Default: `True` if in verbose mode, `False` otherwise. @@ -530,7 +623,7 @@ setLogFormat f options = options { logFormat = f } simpleLogFunc :: LogOptions -> CallStack -> LogSource -> LogLevel -> Utf8Builder -> IO () -simpleLogFunc lo cs _src level msg = do +simpleLogFunc lo cs src level msg = do logLevel <- logMinLevel lo logVerbose <- logVerboseFormat lo @@ -540,18 +633,17 @@ timestamp <> getLevel logVerbose <> ansi reset <> + getSource <> logFormat lo msg <> getLoc <> ansi reset <> "\n" where reset = "\ESC[0m" - setBlack = "\ESC[90m" - setGreen = "\ESC[32m" - setBlue = "\ESC[34m" - setYellow = "\ESC[33m" - setRed = "\ESC[31m" - setMagenta = "\ESC[35m" + lc = logColors lo + levelColor = logColorLogLevels lc level + timestampColor = logColorSecondary lc + locColor = logColorSecondary lc ansi :: Utf8Builder -> Utf8Builder ansi xs | logUseColor lo = xs @@ -561,7 +653,7 @@ getTimestamp logVerbose | logVerbose && logUseTime lo = do now <- getZonedTime - return $ ansi setBlack <> fromString (formatTime' now) <> ": " + return $ ansi timestampColor <> fromString (formatTime' now) <> ": " | otherwise = return mempty where formatTime' = @@ -569,22 +661,26 @@ getLevel :: Bool -> Utf8Builder getLevel logVerbose - | logVerbose = + | logVerbose = ansi levelColor <> case level of - LevelDebug -> ansi setGreen <> "[debug] " - LevelInfo -> ansi setBlue <> "[info] " - LevelWarn -> ansi setYellow <> "[warn] " - LevelError -> ansi setRed <> "[error] " + LevelDebug -> "[debug] " + LevelInfo -> "[info] " + LevelWarn -> "[warn] " + LevelError -> "[error] " LevelOther name -> - ansi setMagenta <> "[" <> display name <> "] " | otherwise = mempty + getSource :: Utf8Builder + getSource = case src of + "" -> "" + _ -> "(" <> display src <> ") " + getLoc :: Utf8Builder getLoc - | logUseLoc lo = ansi setBlack <> "\n@(" <> displayCallStack cs <> ")" + | logUseLoc lo = ansi locColor <> "\n@(" <> displayCallStack cs <> ")" | otherwise = mempty -- | Convert a 'CallStack' value into a 'Utf8Builder' indicating @@ -670,6 +766,42 @@ logFuncUseColorL :: HasLogFunc env => SimpleGetter env Bool logFuncUseColorL = logFuncL.to (maybe False logUseColor . lfOptions) +-- | What color is the log func configured to use for each 'LogLevel'? +-- +-- Intended for use by code which wants to optionally add additional color to +-- its log messages. +-- +-- @since 0.1.18.0 +logFuncLogLevelColorsL :: HasLogFunc env + => SimpleGetter env (LogLevel -> Utf8Builder) +logFuncLogLevelColorsL = logFuncL.to + (maybe defaultLogLevelColors + (logColorLogLevels . logColors) . lfOptions) + +-- | What color is the log func configured to use for secondary content? +-- +-- Intended for use by code which wants to optionally add additional color to +-- its log messages. +-- +-- @since 0.1.18.0 +logFuncSecondaryColorL :: HasLogFunc env + => SimpleGetter env Utf8Builder +logFuncSecondaryColorL = logFuncL.to + (maybe defaultLogSecondaryColor + (logColorSecondary . logColors) . lfOptions) + +-- | What accent colors, indexed by 'Int', is the log func configured to use? +-- +-- Intended for use by code which wants to optionally add additional color to +-- its log messages. +-- +-- @since 0.1.18.0 +logFuncAccentColorsL :: HasLogFunc env + => SimpleGetter env (Int -> Utf8Builder) +logFuncAccentColorsL = logFuncL.to + (maybe defaultLogAccentColors + (logColorAccents . logColors) . lfOptions) + -- | Disable logging capabilities in a given sub-routine -- -- Intended to skip logging in general purpose implementations, where secrets diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.14.1/src/RIO/Prelude/Types.hs new/rio-0.1.18.0/src/RIO/Prelude/Types.hs --- old/rio-0.1.14.1/src/RIO/Prelude/Types.hs 2020-03-01 09:23:42.000000000 +0100 +++ new/rio-0.1.18.0/src/RIO/Prelude/Types.hs 2020-08-05 05:24:55.000000000 +0200 @@ -133,9 +133,15 @@ -- **** @Functor@ -- | Re-exported from "Data.Functor": , Data.Functor.Functor + -- **** @Bifunctor@ + -- | Re-exported from "Data.Bifunctor": + , Data.Bifunctor.Bifunctor -- **** @Foldable@ -- | Re-exported from "Data.Foldable": , Data.Foldable.Foldable + -- **** @Bifoldable@ + -- | Re-exported from "Data.Bifoldable": + , Data.Bifoldable.Bifoldable -- **** @Semigroup@ -- | Re-exported from "Data.Semigroup": , Data.Semigroup.Semigroup @@ -151,6 +157,9 @@ -- **** @Traversable@ -- | Re-exported from "Data.Traversable": , Data.Traversable.Traversable + -- **** @Bitraversable@ + -- | Re-exported from "Data.Bitraversable": + , Data.Bitraversable.Bitraversable -- **** @Monad@ -- | Re-exported from "Control.Monad": , Control.Monad.Monad @@ -287,17 +296,6 @@ , Control.Monad.Primitive.PrimMonad (PrimState) ) where -import qualified Control.Monad.Primitive (PrimMonad(..)) -import qualified Data.ByteString (ByteString) -import qualified Data.ByteString.Builder (Builder) -import qualified Data.Monoid (Monoid) -import qualified Data.Semigroup (Semigroup) -import qualified Data.String (IsString, String) -import qualified Data.Text (Text) -import qualified Data.Typeable -import qualified System.IO - -import qualified Data.Vector.Unboxed (Unbox) import qualified RIO.Prelude.Renames import qualified Control.Applicative @@ -308,9 +306,15 @@ import qualified Control.Monad import qualified Control.Monad.Catch import qualified Control.Monad.Fail +import qualified Control.Monad.Primitive (PrimMonad(..)) import qualified Control.Monad.Reader import qualified Control.Monad.ST +import qualified Data.Bifoldable +import qualified Data.Bifunctor +import qualified Data.Bitraversable import qualified Data.Bool +import qualified Data.ByteString (ByteString) +import qualified Data.ByteString.Builder (Builder) import qualified Data.ByteString.Short import qualified Data.Char import qualified Data.Data @@ -331,14 +335,20 @@ import qualified Data.List.NonEmpty import qualified Data.Map.Strict import qualified Data.Maybe +import qualified Data.Monoid (Monoid) import qualified Data.Ord import qualified Data.Proxy import qualified Data.Ratio +import qualified Data.Semigroup (Semigroup) import qualified Data.Sequence import qualified Data.Set +import qualified Data.String (IsString, String) +import qualified Data.Text (Text) import qualified Data.Text.Encoding.Error import qualified Data.Traversable +import qualified Data.Typeable import qualified Data.Vector +import qualified Data.Vector.Unboxed (Unbox) import qualified Data.Void import qualified Data.Word import qualified Foreign.Storable @@ -347,8 +357,9 @@ import qualified Numeric.Natural import qualified Prelude import qualified System.Exit +import qualified System.IO import qualified Text.Read import qualified Text.Show -- Bring instances for some of the unliftio types in scope, so they can be documented here. -import UnliftIO () +import UnliftIO () diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.14.1/src/RIO/Prelude.hs new/rio-0.1.18.0/src/RIO/Prelude.hs --- old/rio-0.1.14.1/src/RIO/Prelude.hs 2020-03-01 09:23:42.000000000 +0100 +++ new/rio-0.1.18.0/src/RIO/Prelude.hs 2020-08-05 05:24:55.000000000 +0200 @@ -264,6 +264,55 @@ , Control.Monad.when , Control.Monad.unless + -- * @Bifunctor@ + -- | Re-exported from "Data.Bifunctor": + , Data.Bifunctor.bimap + , Data.Bifunctor.first + , Data.Bifunctor.second + + -- * @Bifoldable@ + -- | Re-exported from "Data.Bifoldable": + , Data.Bifoldable.bifold + , Data.Bifoldable.bifoldMap + , Data.Bifoldable.bifoldr + , Data.Bifoldable.bifoldl + , Data.Bifoldable.bifoldr' + , Data.Bifoldable.bifoldr1 + , Data.Bifoldable.bifoldrM + , Data.Bifoldable.bifoldl' + , Data.Bifoldable.bifoldl1 + , Data.Bifoldable.bifoldlM + , Data.Bifoldable.bitraverse_ + , Data.Bifoldable.bifor_ + , Data.Bifoldable.bisequence_ + , Data.Bifoldable.biasum + , Data.Bifoldable.biList + , Data.Bifoldable.binull + , Data.Bifoldable.bilength + , Data.Bifoldable.bielem + , Data.Bifoldable.bimaximum + , Data.Bifoldable.biminimum + , Data.Bifoldable.bisum + , Data.Bifoldable.biproduct + , Data.Bifoldable.biconcat + , Data.Bifoldable.biconcatMap + , Data.Bifoldable.biand + , Data.Bifoldable.bior + , Data.Bifoldable.biany + , Data.Bifoldable.biall + , Data.Bifoldable.bimaximumBy + , Data.Bifoldable.biminimumBy + , Data.Bifoldable.binotElem + , Data.Bifoldable.bifind + + -- * @Bitraverse@ + -- | Re-exported from "Data.Bitraversable": + , Data.Bitraversable.bitraverse + , Data.Bitraversable.bisequence + , Data.Bitraversable.bifor + , Data.Bitraversable.bimapAccumL + , Data.Bitraversable.bimapAccumR + -- * @MonadPlus@ -- | Re-exported from "Control.Monad": , Control.Monad.mzero @@ -273,8 +322,6 @@ -- * @Arrow@ -- | Re-exported from "Control.Arrow" and "Control.Category": - , Control.Arrow.first - , Control.Arrow.second , (Control.Arrow.&&&) , (Control.Arrow.***) , (Control.Category.>>>) @@ -385,61 +432,38 @@ import qualified RIO.Prelude.Text import qualified RIO.Prelude.Types -import Prelude ((*)) -import qualified Prelude - +import qualified Control.Applicative +import qualified Control.Arrow +import qualified Control.Category +import qualified Control.DeepSeq +import qualified Control.Monad +import qualified Control.Monad.Primitive (primitive) +import qualified Control.Monad.Reader +import qualified Control.Monad.ST +import qualified Data.Bifoldable +import qualified Data.Bifunctor +import qualified Data.Bitraversable import qualified Data.Bool - -import qualified Data.Maybe - +import qualified Data.ByteString.Short import qualified Data.Either - -import qualified Data.Tuple - import qualified Data.Eq - -import qualified Data.Ord - -import qualified Data.Word - -import qualified Data.Semigroup - -import qualified Data.Monoid - -import qualified Data.Functor - -import qualified Control.Applicative - -import qualified Control.Monad - import qualified Data.Foldable - -import qualified Data.Traversable - -import qualified Control.Arrow -import qualified Control.Category - import qualified Data.Function - +import qualified Data.Functor import qualified Data.List - +import qualified Data.Maybe +import qualified Data.Monoid +import qualified Data.Ord +import qualified Data.Semigroup import qualified Data.String - -import qualified Text.Show - -import qualified Text.Read - -import qualified Control.DeepSeq - -import qualified Data.Void - -import qualified Control.Monad.Reader - -import qualified Data.ByteString.Short - -import qualified Data.Text.Encoding (decodeUtf8', decodeUtf8With, encodeUtf8, - encodeUtf8Builder) +import qualified Data.Text.Encoding + (decodeUtf8', decodeUtf8With, encodeUtf8, encodeUtf8Builder) import qualified Data.Text.Encoding.Error (lenientDecode) - -import qualified Control.Monad.Primitive (primitive) -import qualified Control.Monad.ST +import qualified Data.Traversable +import qualified Data.Tuple +import qualified Data.Void +import qualified Data.Word +import Prelude ((*)) +import qualified Prelude +import qualified Text.Read +import qualified Text.Show diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.14.1/src/RIO/Process.hs new/rio-0.1.18.0/src/RIO/Process.hs --- old/rio-0.1.14.1/src/RIO/Process.hs 2020-03-01 09:23:42.000000000 +0100 +++ new/rio-0.1.18.0/src/RIO/Process.hs 2020-08-05 05:24:55.000000000 +0200 @@ -407,9 +407,10 @@ end <- getMonotonicTime let diff = end - start useColor <- view logFuncUseColorL + accentColors <- view logFuncAccentColorsL logDebug ("Process finished in " <> - (if useColor then "\ESC[92m" else "") <> -- green + (if useColor then accentColors 0 else "") <> -- accent color 0 timeSpecMilliSecondText diff <> (if useColor then "\ESC[0m" else "") <> -- reset ": " <> display cmdText) @@ -588,7 +589,7 @@ -- ^ Full path to that executable on success findExecutable name | any FP.isPathSeparator name = do names <- addPcExeExtensions name - testFPs (pure $ Left $ ExecutableNotFoundAt name) D.canonicalizePath names + testFPs (pure $ Left $ ExecutableNotFoundAt name) D.makeAbsolute names findExecutable name = do pc <- view processContextL m <- readIORef $ pcExeCache pc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.14.1/src/RIO.hs new/rio-0.1.18.0/src/RIO.hs --- old/rio-0.1.14.1/src/RIO.hs 2020-03-01 09:23:42.000000000 +0100 +++ new/rio-0.1.18.0/src/RIO.hs 2020-08-05 05:24:55.000000000 +0200 @@ -41,7 +41,8 @@ , module RIO.Prelude.Logger -- * Display , module RIO.Prelude.Display - -- * Lens + -- * Optics + -- | @microlens@-based Lenses, Traversals, etc. , module RIO.Prelude.Lens -- * Concurrency , UnliftIO.Concurrent.ThreadId diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rio-0.1.14.1/test/RIO/LoggerSpec.hs new/rio-0.1.18.0/test/RIO/LoggerSpec.hs --- old/rio-0.1.14.1/test/RIO/LoggerSpec.hs 2020-03-01 09:23:42.000000000 +0100 +++ new/rio-0.1.18.0/test/RIO/LoggerSpec.hs 2020-08-05 05:24:55.000000000 +0200 @@ -74,3 +74,15 @@ logInfo "should be formatted" builder <- readIORef ref toLazyByteString builder `shouldBe` "[context] should be formatted\n" + it "noSource" $ do + (ref, options) <- logOptionsMemory + withLogFunc options $ \lf -> runRIO lf $ do + logInfoS "tests" "should appear" + builder <- readIORef ref + toLazyByteString builder `shouldBe` "(tests) should appear\n" + it "noSource verbose" $ do + (ref, options) <- logOptionsMemory + withLogFunc (options & setLogVerboseFormat True) $ \lf -> runRIO lf $ do + logInfoS "tests" "should appear" + builder <- readIORef ref + toLazyByteString builder `shouldBe` "[info] (tests) should appear\n"
