log-warper 1.3.2 → 1.3.3
raw patch · 6 files changed
+30/−23 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ System.Wlog.Severity: instance GHC.Show.Show System.Wlog.Severity.LogRecord
Files
- CHANGES.md +10/−0
- examples/Playground.hs +2/−1
- log-warper.cabal +1/−1
- src/System/Wlog/Logger.hs +16/−18
- src/System/Wlog/Severity.hs +1/−1
- src/System/Wlog/Wrapper.hs +0/−2
CHANGES.md view
@@ -1,3 +1,13 @@+1.3.3+=====++* Fixed a bug related to ugly output to stdout even when it was turned off.++1.3.2+=====++* Minor dependencies update.+ 1.3.1 =====
examples/Playground.hs view
@@ -46,7 +46,8 @@ main :: IO () main = do testToJsonConfigOutput+ let config = (productionB <> prefixB "logs") bracket_- (buildAndSetupYamlLogging (productionB <> prefixB "logs") testLoggerConfigPath)+ (buildAndSetupYamlLogging config testLoggerConfigPath) releaseAllHandlers (testLogging >> showPureLog)
log-warper.cabal view
@@ -1,5 +1,5 @@ name: log-warper-version: 1.3.2+version: 1.3.3 synopsis: Flexible, configurable, monadic and pretty logging homepage: https://github.com/serokell/log-warper license: MIT
src/System/Wlog/Logger.hs view
@@ -54,23 +54,22 @@ , retrieveLogContent ) where -import Control.Concurrent.MVar (modifyMVar, modifyMVar_, withMVar)-import Control.Lens (makeLenses)-import Data.List (isPrefixOf)-import qualified Data.Map as M-import Data.Maybe (fromJust)-import qualified Data.Text as T-import qualified Data.Text.IO as TIO-import System.FilePath ((</>))-import System.IO.Unsafe (unsafePerformIO)+import Control.Concurrent.MVar (modifyMVar, modifyMVar_, withMVar)+import Control.Lens (makeLenses)+import Data.List (isPrefixOf)+import qualified Data.Map as M+import Data.Maybe (fromJust)+import qualified Data.Text as T+import qualified Data.Text.IO as TIO+import System.FilePath ((</>))+import System.IO.Unsafe (unsafePerformIO) import Universum -import System.Wlog.Handler (LogHandler (getTag),- LogHandlerTag (HandlerFilelike), close,- readBack)-import qualified System.Wlog.Handler (handle)-import System.Wlog.Handler.Simple (streamHandler)-import System.Wlog.Severity (LogRecord (..), Severity (..))+import System.Wlog.Handler (LogHandler (getTag),+ LogHandlerTag (HandlerFilelike), close,+ readBack)+import qualified System.Wlog.Handler (handle)+import System.Wlog.Severity (LogRecord (..), Severity (..)) ---------------------------------------------------------------------------@@ -112,11 +111,10 @@ logInternalState :: MVar LogInternalState -- note: only kick up tree if handled locally logInternalState = unsafePerformIO $ do- h <- streamHandler stderr Debug let liTree = M.singleton rootLoggerName $ Logger { _lLevel = Just Warning , _lName = ""- , _lHandlers = [HandlerT h]}+ , _lHandlers = []} liPrefix = Nothing newMVar $ LogInternalState {..} @@ -250,7 +248,7 @@ callHandler :: LogRecord -> String -> HandlerT -> IO () callHandler lr loggername (HandlerT x) = when (handlerFilter $ getTag x) $- System.Wlog.Handler.handle x lr loggername+ System.Wlog.Handler.handle x lr loggername -- | Sets file prefix to 'LogInternalState'. setPrefix :: Maybe FilePath -> IO ()
src/System/Wlog/Severity.hs view
@@ -29,4 +29,4 @@ deriveSafeCopySimple 0 'base ''Severity -- | Internal type of log records.-data LogRecord = LR !Severity !Text+data LogRecord = LR !Severity !Text deriving Show
src/System/Wlog/Wrapper.hs view
@@ -74,8 +74,6 @@ (fromMaybe Warning -> defaultSeverity) = liftIO $ do lock <- liftIO $ newMVar ()- -- We set Debug here, to allow all messages by stdout handler.- -- They will be filtered by loggers. stdoutHandler <- setStdoutFormatter <$> streamHandlerWithLock lock stdout defaultSeverity stderrHandler <- setStderrFormatter <$>