Skip to content

Commit 192cd82

Browse files
authored
Tone down some logInfos to logDebug (#1385)
HLS is too chatty. Lowering the severity of some log messages should indirectly increase the visibility of all other messages
1 parent 1327b9b commit 192cd82

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

ghcide/src/Development/IDE/Core/Rules.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ readHieFileForSrcFromDisk file = do
662662
readHieFileFromDisk :: FilePath -> ExceptT SomeException IdeAction HieFile
663663
readHieFileFromDisk hie_loc = do
664664
nc <- asks ideNc
665-
log <- asks $ L.logInfo . logger
665+
log <- asks $ L.logDebug . logger
666666
res <- liftIO $ tryAny $ loadHieFile (mkUpdater nc) hie_loc
667667
liftIO . log $ either (const $ "FAILED LOADING HIE FILE FOR:" <> T.pack (show hie_loc))
668668
(const $ "SUCCEEDED LOADING HIE FILE FOR:" <> T.pack (show hie_loc))
@@ -835,7 +835,7 @@ getModIfaceFromDiskAndIndexRule = defineEarlyCutoff $ \GetModIfaceFromDiskAndInd
835835
Left err -> fail $ "failed to read .hie file " ++ show hie_loc ++ ": " ++ displayException err
836836
-- can just re-index the file we read from disk
837837
Right hf -> liftIO $ do
838-
L.logInfo (logger se) $ "Re-indexing hie file for" <> T.pack (show f)
838+
L.logDebug (logger se) $ "Re-indexing hie file for" <> T.pack (show f)
839839
indexHieFile se ms f hash hf
840840

841841
let fp = hiFileFingerPrint x

ghcide/src/Development/IDE/LSP/HoverDefinition.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ request label getResults notFound found ide (TextDocumentPositionParams (TextDoc
8282
logAndRunRequest :: T.Text -> (NormalizedFilePath -> Position -> IdeAction b) -> IdeState -> Position -> String -> IO b
8383
logAndRunRequest label getResults ide pos path = do
8484
let filePath = toNormalizedFilePath' path
85-
logInfo (ideLogger ide) $
85+
logDebug (ideLogger ide) $
8686
label <> " request at position " <> T.pack (showPosition pos) <>
8787
" in file: " <> T.pack path
8888
runIdeAction (T.unpack label) (shakeExtras ide) (getResults filePath pos)

ghcide/src/Development/IDE/LSP/Notifications.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,22 @@ setHandlersNotifications = mconcat
5050
-- For example, vscode restores previously unsaved contents on open
5151
modifyFilesOfInterest ide (M.insert file Modified{firstOpen=True})
5252
setFileModified ide False file
53-
logInfo (ideLogger ide) $ "Opened text document: " <> getUri _uri
53+
logDebug (ideLogger ide) $ "Opened text document: " <> getUri _uri
5454

5555
, notificationHandler LSP.STextDocumentDidChange $
5656
\ide (DidChangeTextDocumentParams identifier@VersionedTextDocumentIdentifier{_uri} changes) -> liftIO $ do
5757
updatePositionMapping ide identifier changes
5858
whenUriFile _uri $ \file -> do
5959
modifyFilesOfInterest ide (M.insert file Modified{firstOpen=False})
6060
setFileModified ide False file
61-
logInfo (ideLogger ide) $ "Modified text document: " <> getUri _uri
61+
logDebug (ideLogger ide) $ "Modified text document: " <> getUri _uri
6262

6363
, notificationHandler LSP.STextDocumentDidSave $
6464
\ide (DidSaveTextDocumentParams TextDocumentIdentifier{_uri} _) -> liftIO $ do
6565
whenUriFile _uri $ \file -> do
6666
modifyFilesOfInterest ide (M.insert file OnDisk)
6767
setFileModified ide True file
68-
logInfo (ideLogger ide) $ "Saved text document: " <> getUri _uri
68+
logDebug (ideLogger ide) $ "Saved text document: " <> getUri _uri
6969

7070
, notificationHandler LSP.STextDocumentDidClose $
7171
\ide (DidCloseTextDocumentParams TextDocumentIdentifier{_uri}) -> liftIO $ do
@@ -74,7 +74,7 @@ setHandlersNotifications = mconcat
7474
-- Refresh all the files that depended on this
7575
checkParents <- optCheckParents =<< getIdeOptionsIO (shakeExtras ide)
7676
when (checkParents >= CheckOnClose) $ typecheckParents ide file
77-
logInfo (ideLogger ide) $ "Closed text document: " <> getUri _uri
77+
logDebug (ideLogger ide) $ "Closed text document: " <> getUri _uri
7878

7979
, notificationHandler LSP.SWorkspaceDidChangeWatchedFiles $
8080
\ide (DidChangeWatchedFilesParams fileEvents) -> liftIO $ do
@@ -88,7 +88,7 @@ setHandlersNotifications = mconcat
8888
)
8989
( F.toList fileEvents )
9090
let msg = Text.pack $ show events
91-
logInfo (ideLogger ide) $ "Files created or deleted: " <> msg
91+
logDebug (ideLogger ide) $ "Files created or deleted: " <> msg
9292
modifyFileExists ide events
9393
setSomethingModified ide
9494

@@ -103,7 +103,7 @@ setHandlersNotifications = mconcat
103103
, notificationHandler LSP.SWorkspaceDidChangeConfiguration $
104104
\ide (DidChangeConfigurationParams cfg) -> liftIO $ do
105105
let msg = Text.pack $ show cfg
106-
logInfo (ideLogger ide) $ "Configuration changed: " <> msg
106+
logDebug (ideLogger ide) $ "Configuration changed: " <> msg
107107
modifyClientSettings ide (const $ Just cfg)
108108
setSomethingModified ide
109109

0 commit comments

Comments
 (0)