packages feed

log-warper 1.2.0 → 1.2.1

raw patch · 3 files changed

+11/−4 lines, 3 filesnew-uploader

Files

CHANGES.md view
@@ -1,3 +1,8 @@+1.2.1+=====++* Supports Unix paths in log configs even on Windows.+ 1.2.0 ===== 
log-warper.cabal view
@@ -1,5 +1,5 @@ name:                log-warper-version:             1.2.0+version:             1.2.1 synopsis:            Flexible, configurable, monadic and pretty logging homepage:            https://github.com/serokell/log-warper license:             MIT
src/System/Wlog/LoggerConfig.hs view
@@ -68,6 +68,7 @@                                          object, (.!=), (.:), (.:?), (.=)) import           Formatting             (bprint, shown) import           GHC.Generics           (Generic)+import           System.FilePath        (normalise)  import           System.Wlog.LoggerName (LoggerName) import           System.Wlog.Wrapper    (Severity)@@ -122,8 +123,9 @@  instance ToJSON HandlerWrap instance FromJSON HandlerWrap where+    -- we use 'normalise' so that Unix paths would work on Windows     parseJSON = withObject "handler wrap" $ \o -> do-        (_hwFilePath :: FilePath) <- o .: "file"+        (_hwFilePath :: FilePath) <- normalise <$> o .: "file"         (_hwRounding :: Maybe Int) <- o .:? "round"         pure HandlerWrap{..} @@ -133,8 +135,8 @@ instance ToJSON LoggerTree instance FromJSON LoggerTree where     parseJSON = withObject "loggers tree" $ \o -> do-        (singleFile :: Maybe FilePath) <- o .:? "file"-        (manyFiles :: [FilePath]) <- o .:? "files" .!= []+        (singleFile :: Maybe FilePath) <- fmap normalise <$> o .:? "file"+        (manyFiles :: [FilePath]) <- map normalise <$> (o .:? "files" .!= [])         handlers <- o .:? "handlers" .!= []         let fileHandlers =                 map (\fp -> HandlerWrap fp Nothing) $