From ff516f9d917ffdf0ef54f41a8ecb40d31d49a2d3 Mon Sep 17 00:00:00 2001 From: Andrew Cowie Date: Fri, 5 Aug 2016 22:50:44 +1000 Subject: [PATCH 1/2] Only call logWarn if there's anything to report Closes #2418 --- src/Stack/Fetch.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Stack/Fetch.hs b/src/Stack/Fetch.hs index 3fae1e0e5f..f0dd13941e 100644 --- a/src/Stack/Fetch.hs +++ b/src/Stack/Fetch.hs @@ -531,7 +531,9 @@ fetchPackages' mdistDir toFetchAll = do S.writeFile cabalFP $ tfCabal toFetch atomically $ modifyTVar outputVar $ Map.insert ident destDir - $logWarn $ mconcat $ map (\(path, entryType) -> "Unexpected entry type " <> entryType <> " for entry " <> T.pack path) unexpectedEntries + + F.forM_ unexpectedEntries $ \(path, entryType) -> + logWarnN $ "Unexpected entry type " <> entryType <> " for entry " <> T.pack path -- | Internal function used to unpack tarball. -- From 5a00ac3066e333b5f44f69e31178d295c8239e0e Mon Sep 17 00:00:00 2001 From: Andrew Cowie Date: Fri, 5 Aug 2016 23:23:17 +1000 Subject: [PATCH 2/2] Use Template Haskell logging function as requested --- src/Stack/Fetch.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Stack/Fetch.hs b/src/Stack/Fetch.hs index f0dd13941e..a050d1f8d9 100644 --- a/src/Stack/Fetch.hs +++ b/src/Stack/Fetch.hs @@ -533,7 +533,7 @@ fetchPackages' mdistDir toFetchAll = do atomically $ modifyTVar outputVar $ Map.insert ident destDir F.forM_ unexpectedEntries $ \(path, entryType) -> - logWarnN $ "Unexpected entry type " <> entryType <> " for entry " <> T.pack path + $logWarn $ "Unexpected entry type " <> entryType <> " for entry " <> T.pack path -- | Internal function used to unpack tarball. --