Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions tools/StaticAnalysis/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
// ----------------------------------------------------------------------------------

using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand All @@ -22,9 +21,9 @@
[assembly: AssemblyTitle("DependencyChecker")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyProduct("DependencyChecker")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyCopyright("Copyright © Microsoft Corporation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -48,5 +47,3 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]

28 changes: 14 additions & 14 deletions tools/Tools.Common/Loggers/AnalysisLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ public class AnalysisLogger
private readonly string _exceptionsDirectory;
private static string _defaultLogName;
private static Dictionary<string, AnalysisLogger> _logDictionary;

private log4net.ILog Log4NetLogger { get; set; }

private static Dictionary<string, AnalysisLogger> LogDictionary
{
get { return _logDictionary ?? (_logDictionary = new Dictionary<string, AnalysisLogger>()); }
Expand Down Expand Up @@ -77,12 +74,6 @@ public AnalysisLogger(string baseDirectory, string exceptionsDirectory)
var assembly = Assembly.GetExecutingAssembly();
var assemblyType = assembly.GetType();
_defaultLogName = assembly.GetName().Name;
// TODO: Remove IfDef
#if NETSTANDARD
Log4NetLogger = log4net.LogManager.GetLogger(assemblyType);
#else
Log4NetLogger = log4net.LogManager.GetLogger(_defaultLogName);
#endif
}

/// <summary>
Expand Down Expand Up @@ -235,7 +226,7 @@ public virtual void WriteWarning(string format, params object[] args)
#region Info methods
public void Info(string info)
{
Log4NetLogger.Info(info);
Console.WriteLine(info);
}

public void Info<T>(string info, IEnumerable<T> infoCollection)
Expand Down Expand Up @@ -268,19 +259,28 @@ public void Info<T>(string info, string infoFormat, IEnumerable<T> infoCollectio

private void Error(string errorInfo)
{
Log4NetLogger.Error(errorInfo);
ConsoleColor previousColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(errorInfo);
Console.ForegroundColor = previousColor;
}

public void DebugInfo(string debugInfo)
{
Log4NetLogger.Debug(debugInfo);
ConsoleColor previousColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine(debugInfo);
Console.ForegroundColor = previousColor;
}

private void Warning(string warningInfo)
{
Log4NetLogger.Warn(warningInfo);
ConsoleColor previousColor = Console.ForegroundColor;
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine(warningInfo);
Console.ForegroundColor = previousColor;
}

#endregion
}
}
}
5 changes: 2 additions & 3 deletions tools/Tools.Common/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand All @@ -8,9 +7,9 @@
[assembly: AssemblyTitle("Tools.Common")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyCompany("Microsoft Corporation")]
[assembly: AssemblyProduct("Tools.Common")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyCopyright("Copyright © Microsoft Corporation")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
1 change: 0 additions & 1 deletion tools/Tools.Common/Tools.Common.Netcore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="log4net" Version="2.0.8" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="PowerShellStandard.Library" Version="5.1.0" PrivateAssets="All" />
<PackageReference Include="System.Runtime.Loader" Version="4.0.0" />
Expand Down