Skip to content

Commit 7ee3fb7

Browse files
committed
Fix more putstrln
1 parent a9adef3 commit 7ee3fb7

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ghcide/session-loader/Development/IDE/Session.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import Development.IDE.GHC.Compat hiding (Target,
4848
TargetFile, TargetModule)
4949
import qualified Development.IDE.GHC.Compat as GHC
5050
import Development.IDE.GHC.Util
51+
import Development.IDE.Graph (Action)
5152
import Development.IDE.Session.VersionCheck
5253
import Development.IDE.Types.Diagnostics
5354
import Development.IDE.Types.Exports
@@ -56,7 +57,6 @@ import Development.IDE.Types.HscEnvEq (HscEnvEq, newHscEnvEq,
5657
import Development.IDE.Types.Location
5758
import Development.IDE.Types.Logger
5859
import Development.IDE.Types.Options
59-
import Development.IDE.Graph (Action)
6060
import GHC.Check
6161
import qualified HIE.Bios as HieBios
6262
import HIE.Bios.Environment hiding (getCacheDir)
@@ -152,8 +152,8 @@ setInitialDynFlags logger SessionLoadingOptions{..} = do
152152
-- writing. Actions are picked off one by one from the `HieWriterChan` and executed in serial
153153
-- by a worker thread using a dedicated database connection.
154154
-- This is done in order to serialize writes to the database, or else SQLite becomes unhappy
155-
runWithDb :: FilePath -> (HieDb -> IndexQueue -> IO ()) -> IO ()
156-
runWithDb fp k = do
155+
runWithDb :: Logger -> FilePath -> (HieDb -> IndexQueue -> IO ()) -> IO ()
156+
runWithDb logger fp k = do
157157
-- Delete the database if it has an incompatible schema version
158158
withHieDb fp (const $ pure ())
159159
`catch` \IncompatibleSchemaVersion{} -> removeFile fp
@@ -171,9 +171,9 @@ runWithDb fp k = do
171171
k <- atomically $ readTQueue chan
172172
k db
173173
`catch` \e@SQLError{} -> do
174-
hPutStrLn stderr $ "SQLite error in worker, ignoring: " ++ show e
174+
logWarning logger $ "SQLite error in worker, ignoring: " <> T.pack(show e)
175175
`catchAny` \e -> do
176-
hPutStrLn stderr $ "Uncaught error in database worker, ignoring: " ++ show e
176+
logWarning logger $ "Uncaught error in database worker, ignoring: " <> T.pack(show e)
177177

178178

179179
getHieDbLoc :: FilePath -> IO FilePath
@@ -346,8 +346,8 @@ loadSessionWithOptions SessionLoadingOptions{..} dir = do
346346
res <- loadDLL hscEnv "libm.so.6"
347347
case res of
348348
Nothing -> pure ()
349-
Just err -> hPutStrLn stderr $
350-
"Error dynamically loading libm.so.6:\n" <> err
349+
Just err -> logError logger $
350+
"Error dynamically loading libm.so.6:\n" <> T.pack err
351351

352352
-- Make a map from unit-id to DynFlags, this is used when trying to
353353
-- resolve imports. (especially PackageImports)

0 commit comments

Comments
 (0)