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