Added option --enable-logging to enable diagnostic logging (#106)

* Added option --enable-logging to enable diagnostic logging

* Addressing feedback

* Addressing feedback, round 2
This commit is contained in:
Mitchell Sternke
2016-10-20 17:56:33 -07:00
committed by GitHub
parent 989ad065dd
commit f35b9fda27
3 changed files with 168 additions and 1 deletions

View File

@@ -23,9 +23,16 @@ namespace Microsoft.SqlTools.ServiceLayer
/// </summary>
internal static void Main(string[] args)
{
// read command-line arguments
CommandOptions commandOptions = new CommandOptions(args);
if (commandOptions.ShouldExit)
{
return;
}
// turn on Verbose logging during early development
// we need to switch to Normal when preparing for public preview
Logger.Initialize(minimumLogLevel: LogLevel.Verbose);
Logger.Initialize(minimumLogLevel: LogLevel.Verbose, isEnabled: commandOptions.EnableLogging);
Logger.Write(LogLevel.Normal, "Starting SQL Tools Service Host");
// set up the host details and profile paths