diff --git a/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs b/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs index 32ab434386..232a0316f1 100644 --- a/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs +++ b/src/Umbraco.Core/Logging/DebugDiagnosticsLogger.cs @@ -12,12 +12,12 @@ namespace Umbraco.Core.Logging public void Warn(Type callingType, string message, params Func[] formatItems) { - System.Diagnostics.Debug.Fail(callingType.ToString(), string.Format(message, formatItems.Select(x => x()))); + System.Diagnostics.Debug.Fail(callingType.ToString(), string.Format(message, formatItems.Select(x => x()).ToArray())); } public void WarnWithException(Type callingType, string message, Exception e, params Func[] formatItems) { - System.Diagnostics.Debug.Fail(callingType.ToString(), string.Format(message + Environment.NewLine + e, formatItems.Select(x => x()))); + System.Diagnostics.Debug.Fail(callingType.ToString(), string.Format(message + Environment.NewLine + e, formatItems.Select(x => x()).ToArray())); } public void Info(Type callingType, Func generateMessage) @@ -27,7 +27,7 @@ namespace Umbraco.Core.Logging public void Info(Type type, string generateMessageFormat, params Func[] formatItems) { - System.Diagnostics.Debug.WriteLine(type.ToString(), string.Format(generateMessageFormat, formatItems.Select(x => x()))); + System.Diagnostics.Debug.WriteLine(type.ToString(), string.Format(generateMessageFormat, formatItems.Select(x => x()).ToArray())); } public void Debug(Type callingType, Func generateMessage) @@ -37,7 +37,7 @@ namespace Umbraco.Core.Logging public void Debug(Type type, string generateMessageFormat, params Func[] formatItems) { - System.Diagnostics.Debug.WriteLine(type.ToString(), string.Format(generateMessageFormat, formatItems.Select(x => x()))); + System.Diagnostics.Debug.WriteLine(type.ToString(), string.Format(generateMessageFormat, formatItems.Select(x => x()).ToArray())); } } } \ No newline at end of file diff --git a/src/Umbraco.Tests/Persistence/PetaPocoExtensionsTest.cs b/src/Umbraco.Tests/Persistence/PetaPocoExtensionsTest.cs index 9d17fc17f6..9a5b994522 100644 --- a/src/Umbraco.Tests/Persistence/PetaPocoExtensionsTest.cs +++ b/src/Umbraco.Tests/Persistence/PetaPocoExtensionsTest.cs @@ -232,7 +232,7 @@ namespace Umbraco.Tests.Persistence } // Act - using (DisposableTimer.TraceDuration("starting insert", "finished insert")) + using (ProfilingLogger.TraceDuration("starting insert", "finished insert")) { db.BulkInsertRecords(servers); } diff --git a/src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs b/src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs index 8a5702b8ed..ba2d8a4aa4 100644 --- a/src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs +++ b/src/Umbraco.Tests/TestHelpers/BaseDatabaseFactoryTest.cs @@ -88,7 +88,7 @@ namespace Umbraco.Tests.TestHelpers base.Initialize(); - using (DisposableTimer.TraceDuration("init")) + using (ProfilingLogger.TraceDuration("init")) { //TODO: Somehow make this faster - takes 5s + @@ -165,8 +165,8 @@ namespace Umbraco.Tests.TestHelpers || DatabaseTestBehavior == DatabaseBehavior.NewDbFileAndSchemaPerTest || (_isFirstTestInFixture && DatabaseTestBehavior == DatabaseBehavior.NewDbFileAndSchemaPerFixture)) { - - using (DisposableTimer.TraceDuration("Remove database file")) + + using (ProfilingLogger.TraceDuration("Remove database file")) { RemoveDatabaseFile(ex => { @@ -178,7 +178,7 @@ namespace Umbraco.Tests.TestHelpers } //Create the Sql CE database - using (DisposableTimer.TraceDuration("Create database file")) + using (ProfilingLogger.TraceDuration("Create database file")) { if (_dbBytes != null) { @@ -261,7 +261,7 @@ namespace Umbraco.Tests.TestHelpers [TearDown] public override void TearDown() { - using (DisposableTimer.TraceDuration("teardown")) + using (ProfilingLogger.TraceDuration("teardown")) { _isFirstTestInFixture = false; //ensure this is false before anything!