Improve speed and reduce allocations by implementing logger overloads to avoid params [] allocation (#8917)

* Implement logger overloads to avoid params [] allocation

* Implement console logger ILogger

* Call correct signature

* Fix exceptions

* Introduce ILogger2

* fix logger reference

Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
This commit is contained in:
Chad
2021-02-22 11:22:49 +13:00
committed by GitHub
parent 6eb260001d
commit b8540ca128
121 changed files with 1364 additions and 316 deletions

View File

@@ -50,7 +50,7 @@ namespace Umbraco.Web.Scheduling
dir.Refresh(); //in case it's changed during runtime
if (!dir.Exists)
{
_logger.Debug<TempFileCleanup>("The cleanup folder doesn't exist {Folder}", dir.FullName);
_logger.Debug<TempFileCleanup, string>("The cleanup folder doesn't exist {Folder}", dir.FullName);
return;
}
@@ -66,7 +66,7 @@ namespace Umbraco.Web.Scheduling
}
catch (Exception ex)
{
_logger.Error<TempFileCleanup>(ex, "Could not delete temp file {FileName}", file.FullName);
_logger.Error<TempFileCleanup, string>(ex, "Could not delete temp file {FileName}", file.FullName);
}
}
}