Change calls to logger.Debug method to use Func<string> parameter

This commit is contained in:
Dawid Koruba
2018-06-29 12:35:31 +02:00
parent ce74108848
commit 51ab9e32de
18 changed files with 55 additions and 55 deletions

View File

@@ -443,7 +443,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
throw new ArgumentException("Kit content cannot have children.", nameof(kit));
// ReSharper restore LocalizableElement
_logger.Debug<ContentStore>("Set content ID:" + kit.Node.Id);
_logger.Debug<ContentStore>(() => "Set content ID:" + kit.Node.Id);
var lockInfo = new WriteLockInfo();
try
@@ -568,7 +568,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
if (link?.Value == null) return false;
var content = link.Value;
_logger.Debug<ContentStore>("Clear content ID:" + content.Id);
_logger.Debug<ContentStore>(() => "Clear content ID:" + content.Id);
// clear the entire branch
ClearBranchLocked(content);
@@ -909,7 +909,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
{
// see notes in CreateSnapshot
#if DEBUG
_logger.Debug<ContentStore>("Collect.");
_logger.Debug<ContentStore>(() => "Collect.");
#endif
while (_genRefRefs.TryPeek(out GenRefRef genRefRef) && (genRefRef.Count == 0 || genRefRef.WGenRef.IsAlive == false))
{
@@ -1086,7 +1086,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
#if DEBUG
_logger = logger;
_logger.Debug<Snapshot>("Creating snapshot.");
_logger.Debug<Snapshot>(() => "Creating snapshot.");
#endif
}
@@ -1101,7 +1101,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
#if DEBUG
_logger = logger;
_logger.Debug<Snapshot>("Creating live.");
_logger.Debug<Snapshot>(() => "Creating live.");
#endif
}
@@ -1182,7 +1182,7 @@ namespace Umbraco.Web.PublishedCache.NuCache
{
if (_gen < 0) return;
#if DEBUG
_logger.Debug<Snapshot>("Dispose snapshot (" + (_genRef?.GenRefRef.Count.ToString() ?? "live") + ").");
_logger.Debug<Snapshot>(() => "Dispose snapshot (" + (_genRef?.GenRefRef.Count.ToString() ?? "live") + ").");
#endif
_gen = -1;
if (_genRef != null)