Skip to content

Commit 17fc95d

Browse files
authored
Merge pull request #1317 from well-typed/bolt12/1112
Write trace messages to stderr
2 parents b5f0210 + 9cdf0dd commit 17fc95d

File tree

1 file changed

+4
-4
lines changed
  • hs-bindgen/src-internal/HsBindgen/Util

1 file changed

+4
-4
lines changed

hs-bindgen/src-internal/HsBindgen/Util/Tracer.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import System.Console.ANSI (Color (..), ColorIntensity (Vivid),
5959
ConsoleLayer (Foreground),
6060
SGR (SetColor, SetConsoleIntensity),
6161
hSupportsANSIColor, setSGRCode)
62-
import System.IO (Handle, hPutStr, stdout)
62+
import System.IO (Handle, hPutStr, stderr)
6363
import Text.SimplePrettyPrint (Context, CtxDoc)
6464
import Text.SimplePrettyPrint qualified as PP
6565

@@ -341,10 +341,10 @@ instance Contravariant OutputConfig where
341341

342342
-- | The default tracer configuration
343343
--
344-
-- - writes to 'stdout', and
344+
-- - writes to 'stderr', and
345345
-- - uses ANSI colors, if available.
346346
instance Default (OutputConfig a) where
347-
def = OutputHandle stdout Nothing
347+
def = OutputHandle stderr Nothing
348348

349349
-- | Output configuration suitable for compile-time code generation with
350350
-- Template Haskell.
@@ -480,7 +480,7 @@ instance (Show a, Typeable a) => Exception (TraceException a) where
480480
toException = hsBindgenExceptionToException
481481
fromException = hsBindgenExceptionFromException
482482
-- We only display errors in tests.
483-
displayException (TraceException _) = "An error happend (see above)"
483+
displayException (TraceException _) = "An error happened (see above)"
484484

485485
{-------------------------------------------------------------------------------
486486
Safe tracer

0 commit comments

Comments
 (0)