From c8da5b80854e9dc855e39e78524660d7a31a8c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Fri, 6 Mar 2015 14:04:49 +0100 Subject: [PATCH] Fix line endings in logging output --- Language/Haskell/GhcMod/Logging.hs | 5 ++++- test/TestUtils.hs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Language/Haskell/GhcMod/Logging.hs b/Language/Haskell/GhcMod/Logging.hs index 9c7ebe9..9a089b1 100644 --- a/Language/Haskell/GhcMod/Logging.hs +++ b/Language/Haskell/GhcMod/Logging.hs @@ -23,6 +23,8 @@ module Language.Haskell.GhcMod.Logging ( ) where import Control.Monad +import Data.List +import Data.Char import Data.Monoid (mempty, mappend, mconcat, (<>)) import System.IO import Text.PrettyPrint hiding (style, (<>)) @@ -52,7 +54,8 @@ gmLog level loc' doc = do let loc | loc' == "" = empty | otherwise = text (head $ lines loc') <> colon msg = gmRenderDoc $ gmLogLevelDoc level <+> loc <+> doc + msg' = dropWhileEnd isSpace msg when (Just level <= level') $ - liftIO $ hPutStr stderr msg + liftIO $ hPutStrLn stderr msg' gmlJournal (GhcModLog Nothing [(level, render loc, msg)]) diff --git a/test/TestUtils.hs b/test/TestUtils.hs index d2c8132..1f52a1d 100644 --- a/test/TestUtils.hs +++ b/test/TestUtils.hs @@ -31,7 +31,7 @@ import Test.Hspec import Exception testLogLevel :: GmLogLevel -testLogLevel = GmException +testLogLevel = GmDebug extract :: Show e => IO (Either e a, w) -> IO a extract action = do