using NLog; using System; using System.Threading.Tasks; namespace Sony.Filtr.Tasks.Extensions { public static class TaskExtensions { public static async void TrackDoNotAwaitContinueWithErrorLogging(this Task task, Logger logger, string message) { try { logger.Info($"Started {message}"); await task.ConfigureAwait(false); logger.Info($"Finished {message}"); } catch (Exception ex) { logger.Error(ex, $"Could not {message}"); } } } }