/// <summary>
 /// Create a new instance of this class.
 /// </summary>
 /// <param name="supportedLogLevels">
 /// The levels of logging supported by this provider.
 /// </param>
 public SiftLogProvider(LogLevel[] supportedLogLevels)
 {
     if (supportedLogLevels == null || supportedLogLevels.Length == 0)
     {
         throw new ArgumentNullException(nameof(supportedLogLevels), "No supported log levels");
     }
     _supportedLogLevels = supportedLogLevels;
     if (ApplicationInstance == null)
     {
         ApplicationInstance = this;
     }
 }
Пример #2
0
 public static void Main(string[] argv)
 {
     try
     {
         SiftLogProvider logProvider = new SiftLogProvider(new LogLevel[] { LogLevel.Debug, LogLevel.Error, LogLevel.Info, LogLevel.Warning });
         Logger.ApplicationInstance.AddLogProvider(logProvider);
     }
     catch
     {
         // Intentionall swallowed as we don't have logging yet
     }
     try
     {
         SiftApp app = new SiftApp();
         app.DispatcherUnhandledException           += OnDispatcherUnhandledException;
         AppDomain.CurrentDomain.UnhandledException += OnAppDomainUnhandledException;
         app.Run();
     }
     catch (Exception ex)
     {
         HandleFatalException(ex);
     }
 }