Beispiel #1
0
        /// <summary>
        /// Logs to internal.
        /// </summary>
        /// <param name="level">The level.</param>
        /// <param name="message">The message.</param>
        /// <param name="provider">The provider.</param>
        /// <param name="category">The category.</param>
        /// <exception cref="ArgumentOutOfRangeException">level - null</exception>
        private static void LogToInternal(LogLevel level, string message, ILogProvider provider, string category)
        {
            switch (level)
            {
            case LogLevel.FATAL:
                provider.Fatal(category, message);
                break;

            case LogLevel.ERROR:
                provider.Error(category, message);
                break;

            case LogLevel.WARNING:
                provider.Warning(category, message);
                break;

            case LogLevel.INFO:
                provider.Info(category, message);
                break;

            case LogLevel.TRACE:
                provider.Trace(category, message);
                break;

            case LogLevel.DEBUG:
                provider.Debug(category, message);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(level), level, null);
            }
        }
Beispiel #2
0
 public static void Fatal(string errMsg, Exception ex)
 {
     CheckLogProviderNotNull();
     staticLogProvider.Fatal(errMsg, ex);
 }