Beispiel #1
0
 /// <summary>
 /// Sends the value provided by the provided delegate, only if Fatal is enabled.
 /// </summary>
 /// <typeparam name="T">The type of object we are logging about.</typeparam>
 /// <param name="logger">The logger to use.</param>
 /// <param name="function">The function to evaluate if Fatal logging is enabled.</param>
 public static void Fatal <T>(this IFullLogger logger, Func <string> function)
 {
     if (logger.IsFatalEnabled)
     {
         logger.Fatal <T>(function.Invoke());
     }
 }
        /// <summary>
        /// Sends the value provided by the provided delegate, only if Fatal is enabled.
        /// </summary>
        /// <typeparam name="T">The type of object we are logging about.</typeparam>
        /// <param name="logger">The logger to use.</param>
        /// <param name="function">The function to evaluate if Fatal logging is enabled.</param>
        public static void Fatal <T>(this IFullLogger logger, Func <string> function)
        {
            if (logger is null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            if (function is null)
            {
                throw new ArgumentNullException(nameof(function));
            }

            if (logger.IsFatalEnabled)
            {
                logger.Fatal <T>(function.Invoke());
            }
        }