Servicehost cleanup (#1)

Merge some code clean ups.  Find+Replace 'PowerShell' with 'SQL Tools'.
Enable logger in ServiceHost project.
This commit is contained in:
Karl Burtram
2016-07-15 20:48:31 -07:00
committed by GitHub
parent 790825cfab
commit c78292a680
108 changed files with 347 additions and 340 deletions

View File

@@ -7,7 +7,7 @@ using System;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Simplifies the setup of a SynchronizationContext for the use

View File

@@ -7,7 +7,7 @@ using System;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Provides a simplified interface for creating a new thread

View File

@@ -6,7 +6,7 @@
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Restricts the invocation of an operation to a specified time

View File

@@ -7,7 +7,7 @@ using System;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Provides a simple wrapper over a SemaphoreSlim to allow

View File

@@ -8,7 +8,7 @@ using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Provides a synchronized queue which can be used from within async

View File

@@ -5,7 +5,7 @@
using System;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
internal static class ObjectExtensions
{

View File

@@ -8,7 +8,7 @@ using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Defines the level indicators for log messages.
@@ -54,7 +54,7 @@ namespace Microsoft.PowerShell.EditorServices.Utility
/// Optional. Specifies the minimum log message level to write to the log file.
/// </param>
public static void Initialize(
string logFilePath = "EditorServices.log",
string logFilePath = "SqlToolsService.log",
LogLevel minimumLogLevel = LogLevel.Normal)
{
if (logWriter != null)
@@ -118,32 +118,25 @@ namespace Microsoft.PowerShell.EditorServices.Utility
this.minimumLogLevel = minimumLogLevel;
// Ensure that we have a usable log file path
// if (!Path.IsPathRooted(logFilePath))
// {
// logFilePath =
// Path.Combine(
// #if NanoServer
// AppContext.BaseDirectory,
// #else
// AppDomain.CurrentDomain.BaseDirectory,
// #endif
// logFilePath);
// }
if (!Path.IsPathRooted(logFilePath))
{
logFilePath =
Path.Combine(
AppContext.BaseDirectory,
logFilePath);
}
// if (!this.TryOpenLogFile(logFilePath, deleteExisting))
// {
// // If the log file couldn't be opened at this location,
// // try opening it in a more reliable path
// this.TryOpenLogFile(
// Path.Combine(
// #if NanoServer
// Environment.GetEnvironmentVariable("TEMP"),
// #else
// Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
// #endif
// Path.GetFileName(logFilePath)),
// deleteExisting);
// }
if (!this.TryOpenLogFile(logFilePath, deleteExisting))
{
// If the log file couldn't be opened at this location,
// try opening it in a more reliable path
this.TryOpenLogFile(
Path.Combine(
Environment.GetEnvironmentVariable("TEMP"),
Path.GetFileName(logFilePath)),
deleteExisting);
}
}
public void Write(

View File

@@ -7,7 +7,7 @@ using System;
using System.Collections.Concurrent;
using System.Threading;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Provides a SynchronizationContext implementation that can be used

View File

@@ -6,7 +6,7 @@
using System;
using System.Collections.Generic;
namespace Microsoft.PowerShell.EditorServices.Utility
namespace Microsoft.SqlTools.EditorServices.Utility
{
/// <summary>
/// Provides common validation methods to simplify method