From 0beb3bf4370d4bc762c6ed2b787c7e5f7842b820 Mon Sep 17 00:00:00 2001 From: Robert McRackan Date: Tue, 1 Sep 2020 09:35:13 -0400 Subject: [PATCH] Add logging --- .../UNTESTED/AudibleApiActions.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/InternalUtilities/UNTESTED/AudibleApiActions.cs b/InternalUtilities/UNTESTED/AudibleApiActions.cs index 2a22ba36..11863ad5 100644 --- a/InternalUtilities/UNTESTED/AudibleApiActions.cs +++ b/InternalUtilities/UNTESTED/AudibleApiActions.cs @@ -13,19 +13,33 @@ namespace InternalUtilities { /// USE THIS from within Libation. It wraps the call with correct JSONPath public static Task GetApiAsync(string username, string localeName, ILoginCallback loginCallback = null) - => EzApiCreator.GetApiAsync( + { + Serilog.Log.Logger.Information("GetApiAsync. {@DebugInfo}", new + { + username, + LocaleName = localeName, + }); + return EzApiCreator.GetApiAsync( Localization.Get(localeName), AudibleApiStorage.AccountsSettingsFile, AudibleApiStorage.GetIdentityTokensJsonPath(username, localeName), loginCallback); + } /// USE THIS from within Libation. It wraps the call with correct JSONPath public static Task GetApiAsync(ILoginCallback loginCallback, Account account) - => EzApiCreator.GetApiAsync( + { + Serilog.Log.Logger.Information("GetApiAsync. {@DebugInfo}", new + { + AccountId = account?.AccountId ?? "[empty]", + LocaleName = account?.Locale?.Name + }); + return EzApiCreator.GetApiAsync( account.Locale, AudibleApiStorage.AccountsSettingsFile, account.GetIdentityTokensJsonPath(), loginCallback); + } private static AsyncRetryPolicy policy { get; } = Policy.Handle()