diff --git a/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs b/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs index 4bb7aeb464..e492cda0eb 100644 --- a/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs +++ b/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs @@ -14,6 +14,12 @@ namespace Umbraco.Core.Logging System.Diagnostics.Debug.WriteLine(message + Environment.NewLine + exception, reporting.FullName); } + /// + public void Error(Type reporting, string messageTemplate, Exception exception = null, params object[] args) + { + System.Diagnostics.Debug.WriteLine(string.Format(messageTemplate, args) + Environment.NewLine + exception, reporting.FullName); + } + /// public void Warn(Type reporting, string format) { @@ -32,12 +38,6 @@ namespace Umbraco.Core.Logging System.Diagnostics.Debug.WriteLine(string.Format(format, args), reporting.FullName); } - /// - public void Warn(Type reporting, string format, params Func[] args) - { - System.Diagnostics.Debug.WriteLine(string.Format(format, args.Select(x => x()).ToArray()), reporting.FullName); - } - /// public void Warn(Type reporting, Exception exception, string message) { @@ -56,12 +56,6 @@ namespace Umbraco.Core.Logging System.Diagnostics.Debug.WriteLine(string.Format(format + Environment.NewLine + exception, args), reporting.FullName); } - /// - public void Warn(Type reporting, Exception exception, string format, params Func[] args) - { - System.Diagnostics.Debug.WriteLine(string.Format(format + Environment.NewLine + exception, args.Select(x => x()).ToArray()), reporting.FullName); - } - /// public void Info(Type reporting, string message) { @@ -80,12 +74,6 @@ namespace Umbraco.Core.Logging System.Diagnostics.Debug.WriteLine(string.Format(format, args), reporting.FullName); } - /// - public void Info(Type reporting, string format, params Func[] args) - { - System.Diagnostics.Debug.WriteLine(string.Format(format, args.Select(x => x()).ToArray()), reporting.FullName); - } - /// public void Debug(Type reporting, string message) { @@ -103,11 +91,5 @@ namespace Umbraco.Core.Logging { System.Diagnostics.Debug.WriteLine(string.Format(format, args), reporting.FullName); } - - /// - public void Debug(Type reporting, string format, params Func[] args) - { - System.Diagnostics.Debug.WriteLine(string.Format(format, args.Select(x => x()).ToArray()), reporting.FullName); - } } } diff --git a/src/Umbraco.Tests/TestHelpers/ConsoleLogger.cs b/src/Umbraco.Tests/TestHelpers/ConsoleLogger.cs index d6dfb2d48a..63b0c228bd 100644 --- a/src/Umbraco.Tests/TestHelpers/ConsoleLogger.cs +++ b/src/Umbraco.Tests/TestHelpers/ConsoleLogger.cs @@ -8,7 +8,13 @@ namespace Umbraco.Tests.TestHelpers { public void Error(Type reporting, string message, Exception exception) { - Console.WriteLine("INFO {0} - {1}", reporting.Name, message); + Console.WriteLine("ERROR {0} - {1}", reporting.Name, message); + Console.WriteLine(exception); + } + + public void Error(Type reporting, string messageTemplate, Exception exception = null, params object[] propertyValues) + { + Console.WriteLine("ERROR {0} - {1}", reporting.Name, string.Format(messageTemplate, propertyValues)); Console.WriteLine(exception); } @@ -27,11 +33,6 @@ namespace Umbraco.Tests.TestHelpers Console.WriteLine("WARN {0} - {1}", reporting.Name, string.Format(format, args)); } - public void Warn(Type reporting, string format, params Func[] args) - { - Console.WriteLine("WARN {0} - {1}", reporting.Name, string.Format(format, args.Select(x => x()).ToArray())); - } - public void Warn(Type reporting, Exception exception, string message) { Console.WriteLine("WARN {0} - {1}", reporting.Name, message); @@ -50,18 +51,6 @@ namespace Umbraco.Tests.TestHelpers Console.WriteLine(exception); } - public void Warn(Type reporting, Exception exception, string format, params Func[] args) - { - Console.WriteLine("WARN {0} - {1}", reporting.Name, string.Format(format, args.Select(x => x()).ToArray())); - Console.WriteLine(exception); - } - - public void WarnWithException(Type reporting, string format, Exception e, params Func[] args) - { - Console.WriteLine("WARN {0} - {1}", reporting.Name, string.Format(format, args.Select(x => x()).ToArray())); - Console.WriteLine(e); - } - public void Info(Type reporting, Func generateMessage) { Console.WriteLine("INFO {0} - {1}", reporting.Name, generateMessage()); @@ -72,11 +61,6 @@ namespace Umbraco.Tests.TestHelpers Console.WriteLine("INFO {0} - {1}", reporting.Name, string.Format(format, args)); } - public void Info(Type reporting, string format, params Func[] args) - { - Console.WriteLine("INFO {0} - {1}", reporting.Name, string.Format(format, args.Select(x => x()).ToArray())); - } - public void Info(Type reporting, string message) { Console.WriteLine("INFO {0} - {1}", reporting.Name, message); @@ -96,10 +80,5 @@ namespace Umbraco.Tests.TestHelpers { Console.WriteLine("DEBUG {0} - {1}", reporting.Name, string.Format(format, args)); } - - public void Debug(Type reporting, string format, params Func[] args) - { - Console.WriteLine("DEBUG {0} - {1}", reporting.Name, string.Format(format, args.Select(x => x()).ToArray())); - } } }