mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-27 17:24:26 -05:00
Add command line option to specify the logging directory (#336)
Two changes in this PR: * Add a --log-dir command line parameter and fix command line parsing * Fix command line parsing where arguments with parameter were parsed incorrectly
This commit is contained in:
@@ -73,6 +73,24 @@ namespace Microsoft.SqlTools.Utility
|
||||
|
||||
Logger.isInitialized = true;
|
||||
|
||||
// Create the log directory
|
||||
string logDir = Path.GetDirectoryName(logFilePath);
|
||||
if (!string.IsNullOrWhiteSpace(logDir))
|
||||
{
|
||||
if (!Directory.Exists(logDir))
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(logDir);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Creating the log directory is a best effort operation, so ignore any failures.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// get a unique number to prevent conflicts of two process launching at the same time
|
||||
int uniqueId;
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user