-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Add arguments to direct logs to various locations #3665
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,14 +40,16 @@ data Arguments | |
| PrintLibDir | ||
|
||
data GhcideArguments = GhcideArguments | ||
{argsCommand :: Command | ||
,argsCwd :: Maybe FilePath | ||
,argsShakeProfiling :: Maybe FilePath | ||
,argsTesting :: Bool | ||
,argsExamplePlugin :: Bool | ||
{ argsCommand :: Command | ||
, argsCwd :: Maybe FilePath | ||
, argsShakeProfiling :: Maybe FilePath | ||
, argsTesting :: Bool | ||
, argsExamplePlugin :: Bool | ||
, argsLogLevel :: Priority | ||
, argsLogFile :: Maybe String | ||
-- ^ the minimum log level to show | ||
, argsLogStderr :: Bool | ||
, argsLogClient :: Bool | ||
, argsThreads :: Int | ||
, argsProjectGhcVersion :: Bool | ||
} deriving Show | ||
|
@@ -138,12 +140,40 @@ arguments plugins = GhcideArguments | |
<> help "Sets the log level to Debug, alias for '--log-level Debug'" | ||
) | ||
) | ||
<*> optional (strOption | ||
(long "logfile" | ||
<> short 'l' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would suggest keeping the short form for at least one release cycle. :custom
(lsp-haskell-server-args `("-d" "--log-file" ,lsp-haskell-server-log-file)) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah sorry, that was an oversight, I meant to leave the old options in! I left the old spelling but missed the short option. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although I don't think leaving it in for a release cycle helps all that much: it just means that people will be surprised by it one cycle later. It's only useful if you're switching between and old and new version. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (... then why am I leaving the old spelling in? I guess we could just never remove it) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The one release cycle thing is so you could update clients to use the new one, but if people still ran an older server it would still work. Then in time get rid of it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
-- This option is a little inconsistent with the other log options, since | ||
-- it's not a boolean and there is no way to turn it off. That's okay | ||
-- since the default is off. | ||
<*> (optional (strOption | ||
( long "log-file" | ||
<> metavar "LOGFILE" | ||
<> help "File to log to, defaults to stdout" | ||
)) | ||
<> help "Send logs to a file" | ||
)) <|> (optional (strOption | ||
( long "logfile" | ||
<> metavar "LOGFILE" | ||
<> help "Send logs to a file" | ||
-- deprecated alias so users don't need to update their CLI calls | ||
-- immediately | ||
<> internal | ||
))) | ||
) | ||
-- Boolean option so we can toggle the default in a consistent way | ||
<*> option auto | ||
( long "log-stderr" | ||
<> help "Send logs to stderr" | ||
<> metavar "BOOL" | ||
<> value True | ||
<> showDefault | ||
) | ||
-- Boolean option so we can toggle the default in a consistent way | ||
<*> option auto | ||
( long "log-client" | ||
<> help "Send logs to the client using the window/logMessage LSP method" | ||
<> metavar "BOOL" | ||
-- This is off by default, since some clients will show duplicate logs | ||
-- if we log both to stderr and the client | ||
<> value False | ||
<> showDefault | ||
) | ||
<*> option auto | ||
(short 'j' | ||
<> help "Number of threads (0: automatic)" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this any more since we're not logging to the client by default.