static ILog initializeFacade() { ILog result = Log4NetLogger.Initialize() ?? TraceLogger.Initialize() ?? NoOpLogger.Initialize(); result.Info(Util.DotNetOpenIdVersion); return(result); }
/// <summary> /// Discovers the presence of Log4net.dll and other logging mechanisms /// and returns the best available logger. /// </summary> /// <param name="name">The name of the log to initialize.</param> /// <returns>The <see cref="ILog"/> instance of the logger to use.</returns> private static ILog InitializeFacade(string name) { ILog result = Log4NetLogger.Initialize(name) ?? TraceLogger.Initialize(name) ?? NoOpLogger.Initialize(); result.Info(Util.LibraryVersion); return(result); }
static void Main() { RegisterAppDomainExceptionLogging(); if (ShouldQuitWithoutProperDotNetFramework()) { return; } Log4NetLogger.Initialize(); LogApplicationInfo(); var pluginTypes = new List <Type> { typeof(Plugin.Autosplits.Plugin), typeof(Plugin.FileWriter.Plugin), typeof(Plugin.HttpClient.Plugin), typeof(Plugin.PipeServer.Plugin), typeof(Plugin.Updater.Plugin), }; using (var di = DiabloInterface.Create(pluginTypes)) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainWindow(di)); } }
static void Main() { RegisterAppDomainExceptionLogging(); if (ShouldQuitWithoutProperDotNetFramework()) { return; } Log4NetLogger.Initialize(); var appInfo = new ApplicationInfo { Version = Application.ProductVersion, OS = Environment.OSVersion.VersionString, DotNet = NetFrameworkVersionExtension.FriendlyName(NewestFrameworkVersion) }; LogServiceLocator.Get(typeof(Program)).Info(appInfo); var pluginTypes = new List <Type> { typeof(Plugin.Autosplits.Plugin), typeof(Plugin.FileWriter.Plugin), typeof(Plugin.HttpClient.Plugin), typeof(Plugin.PipeServer.Plugin), typeof(Plugin.Updater.Plugin), }; using (var di = DiabloInterface.Create(appInfo, pluginTypes)) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainWindow(di)); } }
public Startup(IWebHostEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true); Configuration = builder.Build(); _cancellationTokenSource = new CancellationTokenSource(); _logger = new Log4NetLogger(null); _logger.Initialize(nameof(Startup), "log4net.xml"); }
static void Main() { RegisterAppDomainExceptionLogging(); if (ShouldQuitWithoutProperDotNetFramework()) { return; } Log4NetLogger.Initialize(); LogApplicationInfo(); using (var di = DiabloInterface.Create()) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainWindow(di)); } }
/// <summary> /// Discovers the presence of Log4net.dll and other logging mechanisms /// and returns the best available logger. /// </summary> /// <param name="name">The name of the log to initialize.</param> /// <returns>The <see cref="ILog"/> instance of the logger to use.</returns> private static ILog InitializeFacade(string name) { ILog result = Log4NetLogger.Initialize(name) ?? NLogLogger.Initialize(name) ?? TraceLogger.Initialize(name) ?? NoOpLogger.Initialize(); return(result); }
static void InitializeLogger() { Log4NetLogger.Initialize(); LogApplicationInfo(); }