Cleanup ILogger

This commit is contained in:
Stephan
2018-04-03 16:15:59 +02:00
parent e3c6205d0c
commit 553de2ea68
37 changed files with 122 additions and 292 deletions

View File

@@ -65,7 +65,7 @@ namespace Umbraco.Core.Sync
protected IScopeProvider ScopeProvider { get; }
protected Sql<ISqlContext> Sql() => _sqlContext.Sql();
private string DistCacheFilePath => _distCacheFilePath.Value;
#region Messenger
@@ -192,10 +192,9 @@ namespace Umbraco.Core.Sync
if (count > Options.MaxProcessingInstructionCount)
{
//too many instructions, proceed to cold boot
Logger.Warn<DatabaseServerMessenger>("The instruction count ({0}) exceeds the specified MaxProcessingInstructionCount ({1})."
Logger.Warn<DatabaseServerMessenger>(() => $"The instruction count ({count}) exceeds the specified MaxProcessingInstructionCount ({Options.MaxProcessingInstructionCount})."
+ " The server will skip existing instructions, rebuild its caches and indexes entirely, adjust its last synced Id"
+ " to the latest found in the database and maintain cache updates based on that Id.",
() => count, () => Options.MaxProcessingInstructionCount);
+ " to the latest found in the database and maintain cache updates based on that Id.");
coldboot = true;
}

View File

@@ -158,8 +158,7 @@ namespace Umbraco.Core.Sync
{
if (refresher == null) throw new ArgumentNullException(nameof(refresher));
Current.Logger.Debug<ServerMessengerBase>("Invoking refresher {0} on local server for message type RefreshByPayload",
refresher.GetType);
Current.Logger.Debug<ServerMessengerBase>(() => $"Invoking refresher {refresher.GetType()} on local server for message type RefreshByPayload");
var payloadRefresher = refresher as IPayloadCacheRefresher<TPayload>;
if (payloadRefresher == null)
@@ -181,9 +180,7 @@ namespace Umbraco.Core.Sync
{
if (refresher == null) throw new ArgumentNullException(nameof(refresher));
Current.Logger.Debug<ServerMessengerBase>("Invoking refresher {0} on local server for message type {1}",
refresher.GetType,
() => messageType);
Current.Logger.Debug<ServerMessengerBase>(() => $"Invoking refresher {refresher.GetType()} on local server for message type {messageType}");
switch (messageType)
{
@@ -244,9 +241,7 @@ namespace Umbraco.Core.Sync
{
if (refresher == null) throw new ArgumentNullException(nameof(refresher));
Current.Logger.Debug<ServerMessengerBase>("Invoking refresher {0} on local server for message type {1}",
refresher.GetType,
() => messageType);
Current.Logger.Debug<ServerMessengerBase>(() => $"Invoking refresher {refresher.GetType()} on local server for message type {messageType}");
var typedRefresher = refresher as ICacheRefresher<T>;

View File

@@ -160,13 +160,8 @@ namespace Umbraco.Core.Sync
Type idArrayType = null,
string jsonPayload = null)
{
Current.Logger.Debug<WebServiceServerMessenger>(
"Performing distributed call for {0}/{1} on servers ({2}), ids: {3}, json: {4}",
refresher.GetType,
() => messageType,
() => string.Join(";", servers.Select(x => x.ToString())),
() => ids == null ? "" : string.Join(";", ids.Select(x => x.ToString())),
() => jsonPayload ?? "");
Current.Logger.Debug<WebServiceServerMessenger>(() =>
$"Performing distributed call for {refresher.GetType()}/{messageType} on servers ({string.Join(";", servers.Select(x => x.ToString()))}), ids: {(ids == null ? "" : string.Join(";", ids.Select(x => x.ToString())))}, json: {(jsonPayload ?? "")}");
try
{