Skip to content

Commit 271c6e0

Browse files
authored
Use argsVerbose to determine log level in test mode (#717)
1 parent 9f1f554 commit 271c6e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

exe/Main.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,10 @@ main = do
136136
putStrLn "\nStep 3/4: Initializing the IDE"
137137
vfs <- makeVFSHandle
138138
debouncer <- newAsyncDebouncer
139-
let dummyWithProg _ _ f = f (const (pure ()))
139+
let logLevel = if argsVerbose then minBound else Info
140+
dummyWithProg _ _ f = f (const (pure ()))
140141
sessionLoader <- loadSession dir
141-
ide <- initialise def mainRule (pure $ IdInt 0) (showEvent lock) dummyWithProg (const (const id)) (logger minBound) debouncer (defaultIdeOptions sessionLoader) vfs
142+
ide <- initialise def mainRule (pure $ IdInt 0) (showEvent lock) dummyWithProg (const (const id)) (logger logLevel) debouncer (defaultIdeOptions sessionLoader) vfs
142143

143144
putStrLn "\nStep 4/4: Type checking the files"
144145
setFilesOfInterest ide $ HashSet.fromList $ map toNormalizedFilePath' files
@@ -169,4 +170,3 @@ showEvent _ (EventFileDiagnostics _ []) = return ()
169170
showEvent lock (EventFileDiagnostics (toNormalizedFilePath' -> file) diags) =
170171
withLock lock $ T.putStrLn $ showDiagnosticsColored $ map (file,ShowDiag,) diags
171172
showEvent lock e = withLock lock $ print e
172-

0 commit comments

Comments
 (0)