Skip to content

Commit 62815a1

Browse files
author
kokobd
committed
disable debug log in lsp itself
1 parent 1fd6658 commit 62815a1

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ shakeRestart recorder IdeState{..} vfs reason acts =
707707
queue <- atomicallyNamed "actionQueue - peek" $ peekInProgress $ actionQueue shakeExtras
708708

709709
-- this log is required by tests
710-
log Info $ LogBuildSessionRestart reason queue backlog stopTime res
710+
log Debug $ LogBuildSessionRestart reason queue backlog stopTime res
711711
)
712712
-- It is crucial to be masked here, otherwise we can get killed
713713
-- between spawning the new thread and updating shakeSession.

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ import UnliftIO.Concurrent
3434
import UnliftIO.Directory
3535
import UnliftIO.Exception
3636

37+
import qualified Colog.Core as Colog
38+
import Control.Monad.IO.Class
3739
import Control.Monad.IO.Unlift (MonadUnliftIO)
3840
import Development.IDE.Core.IdeConfiguration
3941
import Development.IDE.Core.Shake hiding (Log, Priority)
@@ -108,10 +110,15 @@ runLanguageServer recorder options inH outH defaultConfig onConfigurationChange
108110
, LSP.options = modifyOptions options
109111
}
110112

113+
let lspCologAction :: MonadIO m2 => Colog.LogAction m2 (Colog.WithSeverity LspServerLog)
114+
lspCologAction = toCologActionWithPrio $ cfilter
115+
(\msg -> priority msg >= Info)
116+
(cmapWithPrio LogLspServer recorder)
117+
111118
void $ untilMVar clientMsgVar $
112119
void $ LSP.runServerWithHandles
113-
(toCologActionWithPrio (cmapWithPrio LogLspServer recorder))
114-
(toCologActionWithPrio (cmapWithPrio LogLspServer recorder))
120+
lspCologAction
121+
lspCologAction
115122
inH
116123
outH
117124
serverDefinition

ghcide/test/exe/Main.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6652,10 +6652,7 @@ runInDir'' lspCaps dir startExeIn startSessionIn extraOptions s = do
66526652

66536653
shakeProfiling <- getEnv "SHAKE_PROFILING"
66546654
let cmd = unwords $
6655-
-- With lsp-1.5, verbose logging is causing a lot of deeply nested JSON in ghcide-tests,
6656-
-- and finally results in OOM on a machine with 64GB RAM.
6657-
-- I can't find the root cause now.
6658-
[ghcideExe, "--lsp", "--test", "--verify-core-file", "-j2", "--cwd", startDir
6655+
[ghcideExe, "--lsp", "--test", "--verify-core-file", "--verbose", "-j2", "--cwd", startDir
66596656
] ++ ["--shake-profiling=" <> dir | Just dir <- [shakeProfiling]
66606657
] ++ extraOptions
66616658
-- HIE calls getXgdDirectory which assumes that HOME is set.

0 commit comments

Comments
 (0)