-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move logging from hslogger to co-log
This lines up with the way that logging is being done in `haskell-language-server` and `lsp`. At the moment `hie-bios` is the only reason HLS has a `hslogger` dependency, and it means that the logs from `hie-bios` are inconsistent with those from the rest of the subsystems.
- Loading branch information
Showing
10 changed files
with
172 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,15 @@ | ||
module HIE.Bios.Flags (getCompilerOptions, getCompilerOptionsWithLogger, LoggingFunction) where | ||
module HIE.Bios.Flags (getCompilerOptions) where | ||
|
||
import HIE.Bios.Types | ||
import HIE.Bios.Internal.Log | ||
|
||
import qualified Colog.Core as L | ||
import Data.Text.Prettyprint.Doc | ||
|
||
-- | Initialize the 'DynFlags' relating to the compilation of a single | ||
-- file or GHC session according to the provided 'Cradle'. | ||
getCompilerOptions :: | ||
FilePath -- The file we are loading it because of | ||
-> Cradle a | ||
-> IO (CradleLoadResult ComponentOptions) | ||
getCompilerOptions = | ||
getCompilerOptionsWithLogger logm | ||
|
||
getCompilerOptionsWithLogger :: | ||
LoggingFunction | ||
-> FilePath | ||
getCompilerOptions | ||
:: L.LogAction IO (L.WithSeverity Log) | ||
-> FilePath -- The file we are loading it because of | ||
-> Cradle a | ||
-> IO (CradleLoadResult ComponentOptions) | ||
getCompilerOptionsWithLogger l fp cradle = | ||
runCradle (cradleOptsProg cradle) l fp | ||
|
||
|
||
---------------------------------------------------------------- | ||
getCompilerOptions l fp cradle = runCradle (cradleOptsProg cradle) l fp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.