예제 #1
0
 private static ILogProvider ResolveLogProvider()
 {
     try
     {
         if (NLogLogProvider.IsLoggerAvailable())
         {
             return(new NLogLogProvider());
         }
         if (Log4NetLogProvider.IsLoggerAvailable())
         {
             return(new Log4NetLogProvider());
         }
         if (EntLibLogProvider.IsLoggerAvailable())
         {
             return(new EntLibLogProvider());
         }
         if (SerilogLogProvider.IsLoggerAvailable())
         {
             return(new SerilogLogProvider());
         }
         if (LoupeLogProvider.IsLoggerAvailable())
         {
             return(new LoupeLogProvider());
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(
             "Exception occured resolving a log provider. Logging for this assembly {0} is disabled. {1}",
             typeof(LogProvider).Assembly.FullName,
             ex);
     }
     return(null);
 }