-
Notifications
You must be signed in to change notification settings - Fork 325
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
Adding trace level in diag argument #1681
Changes from 4 commits
56c3c67
e188a59
6f77e35
ed71fdf
fa521cb
371d522
4714b02
090621e
9bce75f
fa1f9ee
7530406
b5939f6
47aa5b3
75700ef
68490bb
17caaf9
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 |
---|---|---|
|
@@ -35,6 +35,11 @@ public ConsoleParameters(IFileHelper fileHelper) | |
this.fileHelper = fileHelper; | ||
} | ||
|
||
/// <summary> | ||
/// Trace level for logs. | ||
/// </summary> | ||
public PlatformTraceLevel TraceLevel { get; set; } = PlatformTraceLevel.Verbose; | ||
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. Should I use System.Diagnostics.TraceLevel here OR Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformTraceLevel. Internally we use PlatformTraceLevel wherever TraceLevel is not present. Example: NETSTANDARD1_4 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. PlatformTraceLevel is in PlatformAbstraction, this will mandate translationlayer users to have a reference to PlatformAbstraction as well. If possible we should remove all the usage for System.Diagnostics.TraceLevel, rather have another TraceLevel enum in OM for this. 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. Removed dependency on platform abstractions. |
||
|
||
/// <summary> | ||
/// Full path for the log file | ||
/// </summary> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,8 @@ internal class DefaultEngineInvoker : | |
|
||
private const string LogFileArgument = "--diag"; | ||
|
||
private const string TraceLevelArgument = "--tracelevel"; | ||
|
||
private const string DataCollectionPortArgument = "--datacollectionport"; | ||
|
||
private const string TelemetryOptedIn = "--telemetryoptedin"; | ||
|
@@ -228,7 +230,8 @@ private static void InitializeEqtTrace(IDictionary<string, string> argsDictionar | |
// Setup logging if enabled | ||
if (argsDictionary.TryGetValue(LogFileArgument, out string logFile)) | ||
{ | ||
EqtTrace.InitializeVerboseTrace(logFile); | ||
var traceLevelInt = CommandLineArgumentsHelper.GetIntArgFromDict(argsDictionary, TraceLevelArgument); | ||
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. verify for invalid tracelevel values, 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. Added check for invalid tracelevel values |
||
EqtTrace.InitializeTrace(logFile, (PlatformTraceLevel)traceLevelInt); | ||
} | ||
else | ||
{ | ||
|
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.
Nit:custom
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.
done