mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-17 02:51:45 -05:00
Fix autoflush option not being used (#1470)
* Fix autoflush option not being used * Remove extra comment
This commit is contained in:
@@ -40,9 +40,7 @@ namespace Microsoft.Kusto.ServiceLayer
|
|||||||
logFilePath = Logger.GenerateLogFilePath("kustoservice");
|
logFilePath = Logger.GenerateLogFilePath("kustoservice");
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.AutoFlush = commandOptions.AutoFlushLog;
|
Logger.Initialize(tracingLevel: commandOptions.TracingLevel, logFilePath: logFilePath, traceSource: "kustoservice", commandOptions.AutoFlushLog);
|
||||||
|
|
||||||
Logger.Initialize(tracingLevel: commandOptions.TracingLevel, logFilePath: logFilePath, traceSource: "kustoservice");
|
|
||||||
|
|
||||||
// set up the host details and profile paths
|
// set up the host details and profile paths
|
||||||
var hostDetails = new HostDetails(version: new Version(1, 0));
|
var hostDetails = new HostDetails(version: new Version(1, 0));
|
||||||
|
|||||||
@@ -38,9 +38,7 @@ namespace Microsoft.SqlTools.Credentials
|
|||||||
logFilePath = Logger.GenerateLogFilePath("credentials");
|
logFilePath = Logger.GenerateLogFilePath("credentials");
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.AutoFlush = commandOptions.AutoFlushLog;
|
Logger.Initialize(tracingLevel: commandOptions.TracingLevel, logFilePath: logFilePath, traceSource: "credentials", commandOptions.AutoFlushLog);
|
||||||
|
|
||||||
Logger.Initialize(tracingLevel: commandOptions.TracingLevel, logFilePath: logFilePath, traceSource: "credentials");
|
|
||||||
|
|
||||||
// set up the host details and profile paths
|
// set up the host details and profile paths
|
||||||
var hostDetails = new HostDetails(
|
var hostDetails = new HostDetails(
|
||||||
|
|||||||
@@ -110,6 +110,9 @@ namespace Microsoft.SqlTools.Utility
|
|||||||
/// <param name="traceSource">
|
/// <param name="traceSource">
|
||||||
/// Optional. Specifies the tracesource name.
|
/// Optional. Specifies the tracesource name.
|
||||||
/// </param>
|
/// </param>
|
||||||
|
/// <param name="autoFlush">
|
||||||
|
/// Optional. Specifies whether the log is flushed after every message
|
||||||
|
/// </param>
|
||||||
public static void Initialize(
|
public static void Initialize(
|
||||||
SourceLevels tracingLevel = defaultTracingLevel,
|
SourceLevels tracingLevel = defaultTracingLevel,
|
||||||
string logFilePath = null,
|
string logFilePath = null,
|
||||||
@@ -140,13 +143,17 @@ namespace Microsoft.SqlTools.Utility
|
|||||||
/// <param name="traceSource">
|
/// <param name="traceSource">
|
||||||
/// Optional. Specifies the tracesource name.
|
/// Optional. Specifies the tracesource name.
|
||||||
/// </param>
|
/// </param>
|
||||||
public static void Initialize(string tracingLevel, string logFilePath = null, string traceSource = defaultTraceSource)
|
/// <param name="autoFlush">
|
||||||
|
/// Optional. Specifies whether the log is flushed after every message
|
||||||
|
/// </param>
|
||||||
|
public static void Initialize(string tracingLevel, string logFilePath = null, string traceSource = defaultTraceSource, bool autoFlush = false)
|
||||||
{
|
{
|
||||||
Initialize(Enum.TryParse<SourceLevels>(tracingLevel, out SourceLevels sourceTracingLevel)
|
Initialize(Enum.TryParse<SourceLevels>(tracingLevel, out SourceLevels sourceTracingLevel)
|
||||||
? sourceTracingLevel
|
? sourceTracingLevel
|
||||||
: defaultTracingLevel
|
: defaultTracingLevel
|
||||||
, logFilePath
|
, logFilePath
|
||||||
, traceSource);
|
, traceSource
|
||||||
|
, autoFlush);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -38,9 +38,8 @@ namespace Microsoft.SqlTools.ResourceProvider
|
|||||||
logFilePath = Logger.GenerateLogFilePath("SqlToolsResourceProviderService");
|
logFilePath = Logger.GenerateLogFilePath("SqlToolsResourceProviderService");
|
||||||
}
|
}
|
||||||
|
|
||||||
// turn on Verbose logging during early development
|
|
||||||
// we need to switch to Information when preparing for public preview
|
// we need to switch to Information when preparing for public preview
|
||||||
Logger.Initialize(tracingLevel: commandOptions.TracingLevel, logFilePath: logFilePath, traceSource: "resourceprovider");
|
Logger.Initialize(tracingLevel: commandOptions.TracingLevel, logFilePath: logFilePath, traceSource: "resourceprovider", commandOptions.AutoFlushLog);
|
||||||
Logger.Write(TraceEventType.Information, "Starting SqlTools Resource Provider");
|
Logger.Write(TraceEventType.Information, "Starting SqlTools Resource Provider");
|
||||||
|
|
||||||
// set up the host details and profile paths
|
// set up the host details and profile paths
|
||||||
|
|||||||
@@ -38,9 +38,7 @@ namespace Microsoft.SqlTools.ServiceLayer
|
|||||||
logFilePath = Logger.GenerateLogFilePath("sqltools");
|
logFilePath = Logger.GenerateLogFilePath("sqltools");
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.AutoFlush = commandOptions.AutoFlushLog;
|
Logger.Initialize(tracingLevel: commandOptions.TracingLevel, logFilePath: logFilePath, traceSource: "sqltools", commandOptions.AutoFlushLog);
|
||||||
|
|
||||||
Logger.Initialize(tracingLevel: commandOptions.TracingLevel, logFilePath: logFilePath, traceSource: "sqltools");
|
|
||||||
|
|
||||||
// set up the host details and profile paths
|
// set up the host details and profile paths
|
||||||
var hostDetails = new HostDetails(version: new Version(1, 0));
|
var hostDetails = new HostDetails(version: new Version(1, 0));
|
||||||
|
|||||||
Reference in New Issue
Block a user