Skip to content

enable ThreadId for when testing #4174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hls-plugin-api/src/Ide/Logger.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ module Ide.Logger
, module PrettyPrinterModule
, renderStrict
, toCologActionWithPrio
, defaultLoggingColumns
) where

import Colog.Core (LogAction (..), Severity,
Expand Down
5 changes: 3 additions & 2 deletions hls-test-utils/src/Test/Hls.hs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ import Data.Proxy (Proxy (Proxy))
import qualified Data.Text as T
import qualified Data.Text.Lazy as TL
import qualified Data.Text.Lazy.Encoding as TL
import Development.IDE (IdeState)
import Development.IDE (IdeState, LoggingColumn (ThreadIdColumn))
import Development.IDE.Main hiding (Log)
import qualified Development.IDE.Main as Ghcide
import qualified Development.IDE.Main as IDEMain
Expand All @@ -94,6 +94,7 @@ import Ide.Logger (Pretty (pretty),
Priority (..), Recorder,
WithPriority (WithPriority, priority),
cfilter, cmapWithPrio,
defaultLoggingColumns,
logWith,
makeDefaultStderrRecorder,
(<+>))
Expand Down Expand Up @@ -348,7 +349,7 @@ pluginTestRecorder = do
-- See 'runSessionWithServer'' for details.
initialiseTestRecorder :: Pretty a => [String] -> IO (Recorder (WithPriority a))
initialiseTestRecorder envVars = do
docWithPriorityRecorder <- makeDefaultStderrRecorder Nothing
docWithPriorityRecorder <- makeDefaultStderrRecorder (Just $ ThreadIdColumn : defaultLoggingColumns)
-- There are potentially multiple environment variables that enable this logger
definedEnvVars <- forM envVars (\var -> fromMaybe "0" <$> lookupEnv var)
let logStdErr = any (/= "0") definedEnvVars
Expand Down
Loading