Skip to content

Commit

Permalink
PR 35: Updated to add more relevent data to log +semver:minor
Browse files Browse the repository at this point in the history
 - Updated to add more relevent data to log +semver:minor
  • Loading branch information
MrHinsh committed Aug 16, 2016
1 parent 4305edf commit 2631816
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
31 changes: 26 additions & 5 deletions TfsWitMigrator.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,41 @@ class RunOptions

static int Main(string[] args)
{
Telemetry.Current.TrackEvent("ApplicationStart");
DateTime startTime = DateTime.Now;
Stopwatch mainTimer = new Stopwatch();
mainTimer.Start();
//////////////////////////////////////////////////
Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
Trace.Listeners.Add(new TextWriterTraceListener(string.Format(@"{0}-{1}.log", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"), "MigrationRun"), "myListener"));
//////////////////////////////////////////////////
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
Trace.WriteLine(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name);
Trace.WriteLine(System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
Trace.WriteLine(string.Format("Telemitery Enabled: {0}", Telemetry.Current.IsEnabled().ToString()));
Trace.WriteLine(string.Format("SessionID: {0}", Telemetry.Current.Context.Session.Id));
Trace.WriteLine(string.Format("User: {0}", Telemetry.Current.Context.User.Id));
Trace.WriteLine(string.Format("Start Time: {0}", startTime.ToUniversalTime()));
Trace.WriteLine("----------------------------------------------------------------");
Trace.WriteLine("------------------------------START-----------------------------");
Trace.WriteLine("----------------------------------------------------------------");
//////////////////////////////////////////////////
int result = (int)Parser.Default.ParseArguments<InitOptions, RunOptions>(args).MapResult(
(InitOptions opts) => RunInitAndReturnExitCode(opts),
(RunOptions opts) => RunExecuteAndReturnExitCode(opts),
errs => 1);
//////////////////////////////////////////////////
Console.WriteLine();
Console.WriteLine("Freedom");
Console.ReadKey();
Trace.WriteLine("----------------------------------------------------------------");
Trace.WriteLine("-------------------------------END------------------------------");
Trace.WriteLine("----------------------------------------------------------------");
mainTimer.Stop();
Telemetry.Current.TrackEvent("ApplicationEnd", null,
new Dictionary<string, double> {
{ "ApplicationDuration", mainTimer.ElapsedMilliseconds }
});
Telemetry.Current.Flush();

Trace.WriteLine(string.Format("Duration: {0}", mainTimer.Elapsed.ToString("c")));
Trace.WriteLine(string.Format("End Time: {0}", startTime.ToUniversalTime()));
return result;
}

Expand Down
4 changes: 3 additions & 1 deletion TfsWitMigrator.Core/_VSTS.DataBulkEditor.Engine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,9 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="ApplicationInsights.config" />
<None Include="ApplicationInsights.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
<None Include="_VSTS.DataBulkEditor.Engine.nuspec" />
</ItemGroup>
Expand Down

0 comments on commit 2631816

Please sign in to comment.