Skip to content

Commit 408479a

Browse files
committed
Add more debug logging.
1 parent 92186b3 commit 408479a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/Scan.hs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ invoke args = do
7676
runnerDebug = isJust (lookup "RUNNER_DEBUG" env)
7777
}
7878

79+
when (runnerDebug context) $ do
80+
putStrLn "Output from hlint:"
81+
putStrLn out
82+
putStrLn ""
83+
7984
case exitCode of
8085
ExitSuccess -> annotate context $ fromString out
8186
_ -> putStrLn err >> exitWith exitCode
@@ -89,6 +94,7 @@ annotate context output = do
8994
when (runnerDebug context) $ do
9095
putStrLn "rewritten output:"
9196
print annotated'
97+
putStrLn ""
9298

9399
case annotated' of
94100
Nothing -> die $ "invalid encoding\n" <> show output <> "\n"
@@ -103,7 +109,12 @@ send context output = do
103109
let endpoint' = toCall env output
104110
case endpoint' of
105111
Just endpoint -> call settings endpoint
106-
_ -> die "not all necessary environment variables available"
112+
_ -> do
113+
when (runnerDebug context) $ do
114+
putStrLn "environment variables"
115+
print env
116+
putStrLn ""
117+
die "not all necessary environment variables available"
107118

108119
call :: GitHubSettings -> GHEndpoint -> IO ()
109120
call settings endpoint =

0 commit comments

Comments
 (0)