Skip to content
Snippets Groups Projects
Commit 6421a26c authored by Hans-Peter Deifel's avatar Hans-Peter Deifel
Browse files

search: Pass debug output from mockup to stderr

Allows the mockup to easily print debugging information by prefixing
each line with "debug".
parent 58869cb7
No related tags found
No related merge requests found
......@@ -192,7 +192,9 @@ parseLine handle = do
then return EOF
else do
line <- T.hGetLine handle
case decodeStrict (T.encodeUtf8 line) of
if "debug" `T.isPrefixOf` line then
T.hPutStrLn stderr line >> parseLine handle
else case decodeStrict (T.encodeUtf8 line) of
Nothing -> error $ "Parser error in line " <> T.unpack line
Just (DecisionRequest num) ->
return $ Decision num
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment