mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-13 19:48:34 -05:00
Use Logger overloads (#2163)
This commit is contained in:
@@ -10,7 +10,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@@ -225,7 +224,7 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx.Contracts
|
||||
if (string.IsNullOrEmpty(displayName))
|
||||
{
|
||||
// not expecting display name for any options as empty string
|
||||
Logger.Write(TraceEventType.Error, string.Format($"Display name is empty for the Object type enum {0}", name));
|
||||
Logger.Error(string.Format($"Display name is empty for the Object type enum {0}", name));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -11,7 +11,6 @@ using Microsoft.SqlTools.ServiceLayer.Utility;
|
||||
using static Microsoft.SqlTools.Utility.SqlConstants;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.DacFx
|
||||
@@ -60,7 +59,7 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
|
||||
{
|
||||
if (!this.cancellation.IsCancellationRequested)
|
||||
{
|
||||
Logger.Write(TraceEventType.Verbose, string.Format("Cancel invoked for OperationId {0}", this.OperationId));
|
||||
Logger.Verbose(string.Format("Cancel invoked for OperationId {0}", this.OperationId));
|
||||
this.cancellation.Cancel();
|
||||
}
|
||||
}
|
||||
@@ -94,7 +93,7 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Write(TraceEventType.Error, string.Format("DacFx import operation {0} failed with exception {1}", this.OperationId, e));
|
||||
Logger.Error(string.Format("DacFx import operation {0} failed with exception {1}", this.OperationId, e));
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using Microsoft.SqlServer.Dac;
|
||||
using Microsoft.SqlTools.ServiceLayer.DacFx.Contracts;
|
||||
@@ -53,7 +52,7 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Write(TraceEventType.Error, string.Format($"{objectTypeValue} is not part of ObjectTypes enum"));
|
||||
Logger.Error(string.Format($"{objectTypeValue} is not part of ObjectTypes enum"));
|
||||
}
|
||||
}
|
||||
// set final values to excludeObjectType property
|
||||
@@ -82,7 +81,7 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Write(TraceEventType.Error, string.Format("Schema compare create options model failed: {0}", e.Message));
|
||||
Logger.Error(string.Format("Schema compare create options model failed: {0}", e.Message));
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.SqlTools.ServiceLayer.DacFx.Contracts;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
using Microsoft.SqlServer.Dac.Model;
|
||||
@@ -45,7 +44,7 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Write(TraceEventType.Information, $"Failed to generate model. Error: {ex.Message}");
|
||||
Logger.Information($"Failed to generate model. Error: {ex.Message}");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user