Skip to content

Commit

Permalink
Add more debug logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
chungyc committed Apr 9, 2023
1 parent 92186b3 commit 408479a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/Scan.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ invoke args = do
runnerDebug = isJust (lookup "RUNNER_DEBUG" env)
}

when (runnerDebug context) $ do
putStrLn "Output from hlint:"
putStrLn out
putStrLn ""

case exitCode of
ExitSuccess -> annotate context $ fromString out
_ -> putStrLn err >> exitWith exitCode
Expand All @@ -89,6 +94,7 @@ annotate context output = do
when (runnerDebug context) $ do
putStrLn "rewritten output:"
print annotated'
putStrLn ""

case annotated' of
Nothing -> die $ "invalid encoding\n" <> show output <> "\n"
Expand All @@ -103,7 +109,12 @@ send context output = do
let endpoint' = toCall env output
case endpoint' of
Just endpoint -> call settings endpoint
_ -> die "not all necessary environment variables available"
_ -> do
when (runnerDebug context) $ do
putStrLn "environment variables"
print env
putStrLn ""
die "not all necessary environment variables available"

call :: GitHubSettings -> GHEndpoint -> IO ()
call settings endpoint =
Expand Down

0 comments on commit 408479a

Please sign in to comment.