-
Notifications
You must be signed in to change notification settings - Fork 418
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
allow loglevel to be passed in as an argument #714
Conversation
@@ -48,6 +48,15 @@ public static void Main(string[] args) | |||
enumerator.MoveNext(); | |||
serverPort = int.Parse((string)enumerator.Current); | |||
} | |||
else if (arg.ToLowerInvariant() == "-loglevel") |
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.
Would it be better to use string.Equals(arg, "-loglevel", StringComparison.OrdinalIgnoreCase)
rather than ToLowerInvariant()
here?
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.
👍
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.
I like it. 👍
We should probably make other longer arguments, such as hostPID
to also allow arguments to be passed in with any case.
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.
LGTM
Added @DustinCampbell in case he had any arguments, but it looks fine to me. -v
will always override -loglevel
which makes sense.
Nope. No complaints. Although, we should consolidate these arguments at some point. |
great. let's punch this in |
This PR introduces a new startup argument
-loglevel {value}
, which allows OmniSharp logging level to be configured from outside.At the moment there is only a
-v
switch which toggles betweeninformation
anddebug
levels, but there is no way to set up more granular logging levels. For now I have not removed the-v
switch yet, so as to not break any existing use case.The PR will allow adding this feature dotnet/vscode-csharp#993 to the editors.