Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only call logWarn if there's anything to report #2445

Merged
merged 2 commits into from
Aug 5, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Only call logWarn if there's anything to report
Closes #2418
  • Loading branch information
istathar committed Aug 5, 2016
commit ff516f9d917ffdf0ef54f41a8ecb40d31d49a2d3
4 changes: 3 additions & 1 deletion src/Stack/Fetch.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, stack never uses logWarnN, since it doesn't record source file and position. Otherwise LGTM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. I didn't know if template haskell would work there. Fixed.


-- | Internal function used to unpack tarball.
--
Expand Down