Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit 20de033

Browse files
committed
Re-enable telemetry for new
1 parent 94107dc commit 20de033

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/dotnet/commands/dotnet-new/NewCommandShim.cs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,18 @@ public static int Run(string[] args)
3131
var sessionId = Environment.GetEnvironmentVariable(MSBuildForwardingApp.TelemetrySessionIdEnvironmentVariableName);
3232
var telemetry = new Telemetry(new NuGetCacheSentinel(new CliFallbackFolderPathCalculator()), sessionId);
3333
var logger = new TelemetryLogger(null);
34-
//(name, props, measures) =>
35-
//{
36-
// if (telemetry.Enabled)
37-
// {
38-
// telemetry.TrackEvent(name, props, measures);
39-
// }
40-
//});
34+
35+
if (telemetry.Enabled)
36+
{
37+
logger = new TelemetryLogger((name, props, measures) =>
38+
{
39+
if (telemetry.Enabled)
40+
{
41+
telemetry.TrackEvent(name, props, measures);
42+
}
43+
});
44+
}
45+
4146
return New3Command.Run(CommandName, CreateHost(), logger, FirstRun, args);
4247
}
4348

0 commit comments

Comments
 (0)