Skip to content

Commit 81f2672

Browse files
soulomoonfendor
andauthored
enable ThreadId for when testing (#4174)
enable ThreadId for when testing --------- Co-authored-by: fendor <[email protected]>
1 parent 5deb996 commit 81f2672

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

hls-plugin-api/src/Ide/Logger.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module Ide.Logger
2727
, module PrettyPrinterModule
2828
, renderStrict
2929
, toCologActionWithPrio
30+
, defaultLoggingColumns
3031
) where
3132

3233
import Colog.Core (LogAction (..), Severity,

hls-test-utils/src/Test/Hls.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ import Data.Proxy (Proxy (Proxy))
8080
import qualified Data.Text as T
8181
import qualified Data.Text.Lazy as TL
8282
import qualified Data.Text.Lazy.Encoding as TL
83-
import Development.IDE (IdeState)
83+
import Development.IDE (IdeState, LoggingColumn (ThreadIdColumn))
8484
import Development.IDE.Main hiding (Log)
8585
import qualified Development.IDE.Main as Ghcide
8686
import qualified Development.IDE.Main as IDEMain
@@ -94,6 +94,7 @@ import Ide.Logger (Pretty (pretty),
9494
Priority (..), Recorder,
9595
WithPriority (WithPriority, priority),
9696
cfilter, cmapWithPrio,
97+
defaultLoggingColumns,
9798
logWith,
9899
makeDefaultStderrRecorder,
99100
(<+>))
@@ -348,7 +349,7 @@ pluginTestRecorder = do
348349
-- See 'runSessionWithServer'' for details.
349350
initialiseTestRecorder :: Pretty a => [String] -> IO (Recorder (WithPriority a))
350351
initialiseTestRecorder envVars = do
351-
docWithPriorityRecorder <- makeDefaultStderrRecorder Nothing
352+
docWithPriorityRecorder <- makeDefaultStderrRecorder (Just $ ThreadIdColumn : defaultLoggingColumns)
352353
-- There are potentially multiple environment variables that enable this logger
353354
definedEnvVars <- forM envVars (\var -> fromMaybe "0" <$> lookupEnv var)
354355
let logStdErr = any (/= "0") definedEnvVars

0 commit comments

Comments
 (0)