Commit 10c4d194 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Send ghc progress output to stdout; fixes #3636

parent d9707981
......@@ -742,9 +742,10 @@ defaultDynFlags =
log_action = \severity srcSpan style msg ->
case severity of
SevInfo -> printErrs (msg style)
SevFatal -> printErrs (msg style)
_ -> do
SevOutput -> printOutput (msg style)
SevInfo -> printErrs (msg style)
SevFatal -> printErrs (msg style)
_ -> do
hPutChar stderr '\n'
printErrs ((mkLocMessage srcSpan msg) style)
-- careful (#2302): printErrs prints in UTF-8, whereas
......
......@@ -53,7 +53,8 @@ pprMessageBag :: Bag Message -> SDoc
pprMessageBag msgs = vcat (punctuate blankLine (bagToList msgs))
data Severity
= SevInfo
= SevOutput
| SevInfo
| SevWarning
| SevError
| SevFatal
......@@ -310,7 +311,7 @@ fatalErrorMsg dflags msg = log_action dflags SevFatal noSrcSpan defaultErrStyle
compilationProgressMsg :: DynFlags -> String -> IO ()
compilationProgressMsg dflags msg
= ifVerbose dflags 1 (log_action dflags SevInfo noSrcSpan defaultUserStyle (text msg))
= ifVerbose dflags 1 (log_action dflags SevOutput noSrcSpan defaultUserStyle (text msg))
showPass :: DynFlags -> String -> IO ()
showPass dflags what
......
......@@ -5,7 +5,8 @@ import Outputable (SDoc)
import SrcLoc (SrcSpan)
data Severity
= SevInfo
= SevOutput
| SevInfo
| SevWarning
| SevError
| SevFatal
......
......@@ -34,7 +34,7 @@ module Outputable (
speakNth, speakNTimes, speakN, speakNOf, plural,
-- * Converting 'SDoc' into strings and outputing it
printSDoc, printErrs, hPrintDump, printDump,
printSDoc, printErrs, printOutput, hPrintDump, printDump,
printForC, printForAsm, printForUser, printForUserPartWay,
pprCode, mkCodeStyle,
showSDoc, showSDocOneLine,
......@@ -287,6 +287,9 @@ printErrs :: Doc -> IO ()
printErrs doc = do Pretty.printDoc PageMode stderr doc
hFlush stderr
printOutput :: Doc -> IO ()
printOutput doc = Pretty.printDoc PageMode stdout doc
printDump :: SDoc -> IO ()
printDump doc = hPrintDump stdout doc
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment