Skip to content

Commit 5737f51

Browse files
peterwicksstringfieldjneiraAilrunmergify[bot]
authored
Delete unused utilities for controlling logging. (#764)
* Delete unused utilities for controlling logging. Delete withFileLogging, logConfig, and noLogConfig. Logging is turned on by hlsCommand. Should we ever want to disable it for a certain test, we would create a new version of hlsCommand, say, hlsCommandNoLog. * Delete unused import. Co-authored-by: Javier Neira <atreyu.bbb@gmail.com> Co-authored-by: Junyoung Clare Jang <jjc9310@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent bf76edb commit 5737f51

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

test/functional/FunctionalBadProject.hs

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ tests = testGroup "behaviour on malformed projects" [
2424

2525
-- testCase "deals with cabal file with unsatisfiable dependency" $
2626
-- runSession hlsCommandExamplePlugin codeActionSupportCaps "test/testdata/badProjects/cabal" $ do
27-
-- -- runSessionWithConfig logConfig hlsCommandExamplePlugin codeActionSupportCaps "test/testdata" $ do
2827
-- _doc <- openDoc "Foo.hs" "haskell"
2928

3029
-- diags@(d:_) <- waitForDiagnosticsSource "bios"

test/utils/Test/Hls/Util.hs

-26
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,11 @@ module Test.Hls.Util
2020
, inspectCommand
2121
, inspectDiagnostic
2222
, knownBrokenForGhcVersions
23-
, logConfig
2423
, logFilePath
25-
, noLogConfig
2624
, setupBuildToolFiles
2725
, waitForDiagnosticsFrom
2826
, waitForDiagnosticsFromSource
2927
, waitForDiagnosticsFromSourceWithTimeout
30-
, withFileLogging
3128
, withCurrentDirectoryInTmp
3229
)
3330
where
@@ -52,7 +49,6 @@ import System.Directory
5249
import System.Environment
5350
import System.Time.Extra (Seconds, sleep)
5451
import System.FilePath
55-
import qualified System.Log.Logger as L
5652
import System.IO.Temp
5753
import System.IO.Unsafe
5854
import Test.Hspec.Runner
@@ -63,35 +59,13 @@ import Test.Tasty.HUnit (assertFailure)
6359
import Text.Blaze.Renderer.String (renderMarkup)
6460
import Text.Blaze.Internal hiding (null)
6561

66-
67-
noLogConfig :: Test.SessionConfig
68-
noLogConfig = Test.defaultConfig { Test.logMessages = False }
69-
70-
logConfig :: Test.SessionConfig
71-
logConfig = Test.defaultConfig { Test.logMessages = True }
72-
7362
codeActionSupportCaps :: C.ClientCapabilities
7463
codeActionSupportCaps = def { C._textDocument = Just textDocumentCaps }
7564
where
7665
textDocumentCaps = def { C._codeAction = Just codeActionCaps }
7766
codeActionCaps = C.CodeActionClientCapabilities (Just True) (Just literalSupport)
7867
literalSupport = C.CodeActionLiteralSupport def
7968

80-
withFileLogging :: FilePath -> IO a -> IO a
81-
withFileLogging logFile f = do
82-
let logDir = "./test-logs"
83-
logPath = logDir </> logFile
84-
85-
dirExists <- doesDirectoryExist logDir
86-
unless dirExists $ createDirectory logDir
87-
88-
exists <- doesFileExist logPath
89-
when exists $ removeFile logPath
90-
91-
setupLogger (Just logPath) ["hie"] L.DEBUG
92-
93-
f
94-
9569
-- ---------------------------------------------------------------------
9670

9771
setupBuildToolFiles :: IO ()

0 commit comments

Comments
 (0)