Skip to content

Commit e6c9641

Browse files
authored
Remove log4dotnet lib (#12662)
1 parent 6daf098 commit e6c9641

File tree

4 files changed

+18
-23
lines changed

4 files changed

+18
-23
lines changed

tools/StaticAnalysis/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System.Reflection;
16-
using System.Runtime.CompilerServices;
1716
using System.Runtime.InteropServices;
1817

1918
// General Information about an assembly is controlled through the following
@@ -22,9 +21,9 @@
2221
[assembly: AssemblyTitle("DependencyChecker")]
2322
[assembly: AssemblyDescription("")]
2423
[assembly: AssemblyConfiguration("")]
25-
[assembly: AssemblyCompany("")]
24+
[assembly: AssemblyCompany("Microsoft Corporation")]
2625
[assembly: AssemblyProduct("DependencyChecker")]
27-
[assembly: AssemblyCopyright("Copyright © 2016")]
26+
[assembly: AssemblyCopyright("Copyright © Microsoft Corporation")]
2827
[assembly: AssemblyTrademark("")]
2928
[assembly: AssemblyCulture("")]
3029

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

tools/Tools.Common/Loggers/AnalysisLogger.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ public class AnalysisLogger
3131
private readonly string _exceptionsDirectory;
3232
private static string _defaultLogName;
3333
private static Dictionary<string, AnalysisLogger> _logDictionary;
34-
35-
private log4net.ILog Log4NetLogger { get; set; }
36-
3734
private static Dictionary<string, AnalysisLogger> LogDictionary
3835
{
3936
get { return _logDictionary ?? (_logDictionary = new Dictionary<string, AnalysisLogger>()); }
@@ -77,12 +74,6 @@ public AnalysisLogger(string baseDirectory, string exceptionsDirectory)
7774
var assembly = Assembly.GetExecutingAssembly();
7875
var assemblyType = assembly.GetType();
7976
_defaultLogName = assembly.GetName().Name;
80-
// TODO: Remove IfDef
81-
#if NETSTANDARD
82-
Log4NetLogger = log4net.LogManager.GetLogger(assemblyType);
83-
#else
84-
Log4NetLogger = log4net.LogManager.GetLogger(_defaultLogName);
85-
#endif
8677
}
8778

8879
/// <summary>
@@ -235,7 +226,7 @@ public virtual void WriteWarning(string format, params object[] args)
235226
#region Info methods
236227
public void Info(string info)
237228
{
238-
Log4NetLogger.Info(info);
229+
Console.WriteLine(info);
239230
}
240231

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

269260
private void Error(string errorInfo)
270261
{
271-
Log4NetLogger.Error(errorInfo);
262+
ConsoleColor previousColor = Console.ForegroundColor;
263+
Console.ForegroundColor = ConsoleColor.Red;
264+
Console.WriteLine(errorInfo);
265+
Console.ForegroundColor = previousColor;
272266
}
273267

274268
public void DebugInfo(string debugInfo)
275269
{
276-
Log4NetLogger.Debug(debugInfo);
270+
ConsoleColor previousColor = Console.ForegroundColor;
271+
Console.ForegroundColor = ConsoleColor.Gray;
272+
Console.WriteLine(debugInfo);
273+
Console.ForegroundColor = previousColor;
277274
}
278275

279276
private void Warning(string warningInfo)
280277
{
281-
Log4NetLogger.Warn(warningInfo);
278+
ConsoleColor previousColor = Console.ForegroundColor;
279+
Console.ForegroundColor = ConsoleColor.Yellow;
280+
Console.WriteLine(warningInfo);
281+
Console.ForegroundColor = previousColor;
282282
}
283283

284284
#endregion
285285
}
286-
}
286+
}

tools/Tools.Common/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
// General Information about an assembly is controlled through the following
@@ -8,9 +7,9 @@
87
[assembly: AssemblyTitle("Tools.Common")]
98
[assembly: AssemblyDescription("")]
109
[assembly: AssemblyConfiguration("")]
11-
[assembly: AssemblyCompany("")]
10+
[assembly: AssemblyCompany("Microsoft Corporation")]
1211
[assembly: AssemblyProduct("Tools.Common")]
13-
[assembly: AssemblyCopyright("Copyright © 2018")]
12+
[assembly: AssemblyCopyright("Copyright © Microsoft Corporation")]
1413
[assembly: AssemblyTrademark("")]
1514
[assembly: AssemblyCulture("")]
1615

tools/Tools.Common/Tools.Common.Netcore.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
</PropertyGroup>
1919

2020
<ItemGroup>
21-
<PackageReference Include="log4net" Version="2.0.8" />
2221
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
2322
<PackageReference Include="PowerShellStandard.Library" Version="5.1.0" PrivateAssets="All" />
2423
<PackageReference Include="System.Runtime.Loader" Version="4.0.0" />

0 commit comments

Comments
 (0)