/// <summary>
        /// Log Exceptions.
        /// </summary>
        /// <param name="exceptions">Exception to be logged.</param>
        /// <returns>Operation result detailing whether log was successful.</returns>
        public OperationResult LogExceptions(params Exception[] exceptions)
        {
            var operation = Get.OperationResult(() => _logger.Log(_formatter.FormatException(exceptions)));

            ErrorLogged?.Invoke(this, new GenericEventArgs <bool>(operation.WasSuccessful));
            return(operation);
        }
Esempio n. 2
0
 /// <summary>
 /// Log Exceptions Asynchronously.
 /// </summary>
 /// <param name="exceptions">Exception to be logged.</param>
 /// <returns>Operation result detailing whether log was successful.</returns>
 public async Task <OperationResult> LogExceptionsAsync(params Exception[] exceptions) =>
 await Get.OperationResultAsync(() => _logger.Log(_formatter.FormatException(exceptions)));