Logging for ga (#698)

Adding a robustness change to call close on logger before process exit.
Also adding a designer.cs file needed by a script csproj that got missed out in previous checkin due to .gitignore entry.
This commit is contained in:
ranasaria
2018-09-25 17:26:22 -07:00
committed by GitHub
parent 41d0ef1814
commit 335e9fb38c
4 changed files with 202 additions and 1 deletions

View File

@@ -62,6 +62,10 @@ namespace Microsoft.SqlTools.Credentials
Logger.WriteWithCallstack(TraceEventType.Critical, $"An unhandled exception occurred: {e}");
Environment.Exit(1);
}
finally
{
Logger.Close();
}
}
}
}

View File

@@ -61,7 +61,11 @@ namespace Microsoft.SqlTools.ResourceProvider
catch (Exception e)
{
Logger.WriteWithCallstack(TraceEventType.Critical, $"An unhandled exception occurred: {e}");
Environment.Exit(1);
Environment.Exit(1);
}
finally
{
Logger.Close();
}
}
}

View File

@@ -58,6 +58,10 @@ namespace Microsoft.SqlTools.ServiceLayer
Logger.WriteWithCallstack(TraceEventType.Critical, $"An unhandled exception occurred: {e}");
Environment.Exit(1);
}
finally
{
Logger.Close();
}
}
}
}

View File

@@ -0,0 +1,189 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace ScriptGenerator.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ScriptGenerator.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to USE [master]
///GO
////****** Object: Database [AdventureWorks] Script Date: 9/6/2018 12:11:50 PM ******/
///CREATE DATABASE [AdventureWorks]
/// CONTAINMENT = NONE
/// ON PRIMARY
///( NAME = N&apos;AdventureWorks_Data&apos;, FILENAME = N&apos;D:\sql\14.0.1000.169\sqlservr\data\AdventureWorks_Data.mdf&apos; , SIZE = 174080KB , MAXSIZE = UNLIMITED, FILEGROWTH = 16384KB )
/// LOG ON
///( NAME = N&apos;AdventureWorks_Log&apos;, FILENAME = N&apos;D:\sql\14.0.1000.169\sqlservr\data\AdventureWorks_Log.ldf&apos; , SIZE = 18432KB , MAXSIZE = 2048GB , FILEGROWTH = [rest of string was truncated]&quot;;.
/// </summary>
internal static string AdventureWorks {
get {
return ResourceManager.GetString("AdventureWorks", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to USE [AdventureWorks]
///GO
///SET ANSI_NULLS OFF
///GO
///SET QUOTED_IDENTIFIER OFF
///GO
///
///CREATE PROCEDURE [dbo].[AllocatePageInMixedExtent]
/// @dbName [dbo].[SinglePartNameType],
/// @p [dbo].[Partition],
/// @pg [dbo].[PageId]
///WITH EXECUTE AS CALLER
///AS
///EXTERNAL NAME [AMAPI].[SqlTest.Api.OnDiskStructures.Corruptions].[AllocatePageInMixedExtent]
///GO
////****** Object: StoredProcedure [dbo].[AllocatePageInUniformExtent] Script Date: 9/6/2018 12:11:53 PM ******/
///SET ANSI_NULLS OFF
///GO
///SET QUOTED_IDENTIFIER OFF
///GO [rest of string was truncated]&quot;;.
/// </summary>
internal static string AdventureWorksStoredProceduresCreate {
get {
return ResourceManager.GetString("AdventureWorksStoredProceduresCreate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to USE [AdventureWorks]
///GO
////****** Object: Table [Sales].[Customer] Script Date: 9/6/2018 12:11:50 PM ******/
///SET ANSI_NULLS ON
///GO
///SET QUOTED_IDENTIFIER ON
///GO
///CREATE TABLE [Sales].[Customer](
/// [CustomerID] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,
/// [TerritoryID] [int] NULL,
/// [AccountNumber] AS (isnull(&apos;AW&apos;+[dbo].[ufnLeadingZeros]([CustomerID]),&apos;&apos;)),
/// [CustomerType] [nchar](1) NOT NULL,
/// [rowguid] [uniqueidentifier] ROWGUIDCOL NOT NULL,
/// [ModifiedDate] [datetime] NOT NULL,
/// CONSTRAIN [rest of string was truncated]&quot;;.
/// </summary>
internal static string AdventureWorksTablesCreate {
get {
return ResourceManager.GetString("AdventureWorksTablesCreate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to USE [AdventureWorks]
///GO
///
///SET ANSI_NULLS ON
///GO
///SET QUOTED_IDENTIFIER ON
///GO
///
///
///
///CREATE VIEW [Person].[vAdditionalContactInfo]
///AS
///SELECT
/// [ContactID]
/// ,[FirstName]
/// ,[MiddleName]
/// ,[LastName]
/// ,[ContactInfo].ref.value(N&apos;declare namespace ci=&quot;http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo&quot;;
/// declare namespace act=&quot;http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes&quot;;
/// (act:telephoneNumber)[1]/act:number&apos;, &apos;n [rest of string was truncated]&quot;;.
/// </summary>
internal static string AdventureWorksViewsCreate {
get {
return ResourceManager.GetString("AdventureWorksViewsCreate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to USE [master]
///GO
///Exec sp_configure &apos;show advanced option&apos;, &apos;1&apos;; RECONFIGURE;
///go
///EXEC sp_configure &apos;clr strict security&apos;, 0; RECONFIGURE;
///go
///.
/// </summary>
internal static string TurnOffClrStrictSecurityMode {
get {
return ResourceManager.GetString("TurnOffClrStrictSecurityMode", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to USE [master]
///GO
///
///EXEC sp_configure &apos;clr strict security&apos;, 1; RECONFIGURE;
///go
///Exec sp_configure &apos;show advanced option&apos;, &apos;0&apos;; RECONFIGURE;
///go.
/// </summary>
internal static string TurnOnClrStrictSecurityMode {
get {
return ResourceManager.GetString("TurnOnClrStrictSecurityMode", resourceCulture);
}
}
}
}