public static void Main(string[] args) { try { var startupContext = new StartupContext(args); NzbDroneLogger.Register(startupContext, true, true); Logger.Info("Starting Prowlarr Update Client"); var container = new Container(rules => rules.WithNzbDroneRules()) .AutoAddServices(new List <string> { "Prowlarr.Update" }) .AddNzbDroneLogger() .AddStartupContext(startupContext); container.Resolve <InitializeLogger>().Initialize(); container.Resolve <UpdateApp>().Start(args); Logger.Info("Update completed successfully"); } catch (Exception e) { Logger.Fatal(e, "An error has occurred while applying update package."); } }
public static void Main(string[] args) { try { var startupArgs = new StartupContext(args); try { NzbDroneLogger.Register(startupArgs, false, true); } catch (Exception ex) { System.Console.WriteLine("NLog Exception: " + ex.ToString()); throw; } Bootstrap.Start(startupArgs, new ConsoleAlerts()); } catch (SocketException e) { System.Console.WriteLine(""); System.Console.WriteLine(""); Logger.Fatal(e.Message + ". This can happen if another instance of Radarr is already running another application is using the same port (default: 7878) or the user has insufficient permissions"); Exit(ExitCodes.RecoverableFailure); } catch (Exception e) { System.Console.WriteLine(""); System.Console.WriteLine(""); Logger.Fatal(e, "EPIC FAIL!"); Exit(ExitCodes.UnknownFailure); } Logger.Info("Exiting main."); Exit(ExitCodes.Normal); }
public static void Main(string[] args) { try { var startupArgs = new StartupContext(args); NzbDroneLogger.Register(startupArgs, false, true); Bootstrap.Start(startupArgs, new ConsoleAlerts()); } catch (SocketException exception) { System.Console.WriteLine(""); System.Console.WriteLine(""); Logger.Fatal(exception.Message + ". This can happen if another instance of Sonarr is already running another application is using the same port (default: 8989) or the user has insufficient permissions"); System.Console.WriteLine("Press any key to exit..."); System.Console.ReadLine(); Environment.Exit(1); } catch (Exception e) { System.Console.WriteLine(""); System.Console.WriteLine(""); Logger.FatalException("EPIC FAIL!", e); System.Console.WriteLine("Press any key to exit..."); System.Console.ReadLine(); Environment.Exit(1); } Logger.Info("Exiting main."); //Need this to terminate on mono (thanks nlog) LogManager.Configuration = null; Environment.Exit(0); }
public AppFolderInfo(IDiskProvider diskProvider, IStartupArguments startupArguments) { _diskProvider = diskProvider; if (OsInfo.IsLinux) { DATA_SPECIAL_FOLDER = Environment.SpecialFolder.ApplicationData; } _logger = NzbDroneLogger.GetLogger(this); if (startupArguments.Args.ContainsKey(StartupArguments.APPDATA)) { AppDataFolder = startupArguments.Args[StartupArguments.APPDATA]; } else { AppDataFolder = Path.Combine(Environment.GetFolderPath(DATA_SPECIAL_FOLDER, Environment.SpecialFolderOption.None), "NzbDrone"); } _diskProvider.EnsureFolder(AppDataFolder); StartUpFolder = new FileInfo(Assembly.GetExecutingAssembly().Location).Directory.FullName; TempFolder = Path.GetTempPath(); diskProvider.EnsureFolder(AppDataFolder); if (!OsInfo.IsLinux) { SetPermissions(); } }
public NewznabRequestGenerator(INewznabCapabilitiesProvider capabilitiesProvider) { _logger = NzbDroneLogger.GetLogger(GetType()); _capabilitiesProvider = capabilitiesProvider; MaxPages = 30; PageSize = 100; }
public AppFolderFactory(IAppFolderInfo appFolderInfo, IStartupContext startupContext, IDiskProvider diskProvider, IDiskTransferService diskTransferService) { _appFolderInfo = appFolderInfo; _diskProvider = diskProvider; _logger = NzbDroneLogger.GetLogger(this); }
public void HandleAsync(ApplicationStartedEvent message) { EnsureDefaultConfigFile(); DeleteOldValues(); if (!AnalyticsEnabled) { NzbDroneLogger.UnRegisterRemoteLoggers(); } }
public void Setup() { Mocker.Resolve <ILogRepository, LogRepository>(); Mocker.Resolve <DatabaseTarget>().Register(); LogManager.ReconfigExistingLoggers(); _logger = NzbDroneLogger.GetLogger(this); _uniqueMessage = "Unique message: " + Guid.NewGuid(); }
static void Main(string[] args) { try { var oldColor = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("AGN Gaming Radarr Hotpatch Loading..."); Console.WriteLine("Attempting to bootstrap Radarr, here goes!"); Console.ForegroundColor = oldColor; var patchManager = new PatchManager(); var startupArgs = new StartupContext(args); try { NzbDroneLogger.Register(startupArgs, false, true); } catch (Exception ex) { System.Console.WriteLine("NLog Exception: " + ex.ToString()); throw; } if (patchManager.BeginPatching()) { Utility.WriteToConsole("All patches successful, starting Radarr.", ConsoleColor.Green); Bootstrap.Start(startupArgs, new ConsoleAlerts()); } else { Console.WriteLine(""); Console.WriteLine(""); Logger.Fatal("Some HotPatch patches were not applied successfully. Are you using a supported version of Radarr?"); Exit(ExitCodes.UnknownFailure); } } catch (SocketException e) { System.Console.WriteLine(""); System.Console.WriteLine(""); Logger.Fatal(e.Message + ". This can happen if another instance of Radarr is already running another application is using the same port (default: 7878) or the user has insufficient permissions"); Exit(ExitCodes.RecoverableFailure); } catch (Exception e) { System.Console.WriteLine(""); System.Console.WriteLine(""); Logger.Fatal(e, "EPIC FAIL!"); Exit(ExitCodes.UnknownFailure); } }
public static void Main(string[] args) { try { var startupArgs = new StartupContext(args); NzbDroneLogger.Register(startupArgs, false, true); Bootstrap.Start(args, e => { e.ConfigureServices((_, s) => s.AddSingleton <IHostedService, SystemTrayApp>()); }); } catch (Exception e) { Logger.Fatal(e, "EPIC FAIL"); MessageBox.Show($"{e.GetType().Name}: {e.Message}", buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Error, caption: "Epic Fail!"); } }
public static void Main(string[] args) { try { var startupContext = new StartupContext(args); NzbDroneLogger.Register(startupContext, true, true); Logger.Info("Starting Lidarr Update Client"); _container = UpdateContainerBuilder.Build(startupContext); _container.Resolve <InitializeLogger>().Initialize(); _container.Resolve <UpdateApp>().Start(args); Logger.Info("Update completed successfully"); } catch (Exception e) { Logger.Fatal(e, "An error has occurred while applying update package."); } }
public static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.SetHighDpiMode(HighDpiMode.SystemAware); try { var startupArgs = new StartupContext(args); NzbDroneLogger.Register(startupArgs, false, true); Bootstrap.Start(args, e => { e.ConfigureServices((_, s) => s.AddSingleton <IHostedService, SystemTrayApp>()); }); } catch (Exception e) { Logger.Fatal(e, "EPIC FAIL"); MessageBox.Show($"{e.GetType().Name}: {e}", buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Error, caption: "Epic Fail!"); } }
public static void Main(string[] args) { try { var startupArgs = new StartupContext(args); NzbDroneLogger.Register(startupArgs, false, true); Bootstrap.Start(startupArgs, new MessageBoxUserAlert(), container => { container.Register <ISystemTrayApp, SystemTrayApp>(); var trayApp = container.Resolve <ISystemTrayApp>(); trayApp.Start(); }); } catch (Exception e) { Logger.Fatal(e, "EPIC FAIL"); MessageBox.Show($"{e.GetType().Name}: {e.Message}", buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Error, caption: "Epic Fail!"); } }
public static IContainer Start(StartupArguments args, IUserAlert userAlert) { var logger = NzbDroneLogger.GetLogger(); GlobalExceptionHandlers.Register(); IgnoreCertErrorPolicy.Register(); logger.Info("Starting NzbDrone Console. Version {0}", Assembly.GetExecutingAssembly().GetName().Version); if (!PlatformValidation.IsValidate(userAlert)) { throw new TerminateApplicationException(); } var container = MainAppContainerBuilder.BuildContainer(args); DbFactory.RegisterDatabase(container); container.Resolve <Router>().Route(); return(container); }
public static void Main(string[] args) { try { var startupArgument = new StartupContext(args); NzbDroneLogger.Register(startupArgument, true, true); Logger.Info("Starting Sonarr Update Client"); X509CertificateValidationPolicy.Register(); _container = UpdateContainerBuilder.Build(startupArgument); Logger.Info("Updating Sonarr to version {0}", BuildInfo.Version); _container.Resolve <UpdateApp>().Start(args); Logger.Info("Update completed successfully"); } catch (Exception e) { Logger.FatalException("An error has occurred while applying update package.", e); } }
public static void Main(string[] args) { StartupContext startupArgs = null; try { startupArgs = new StartupContext(args); try { NzbDroneLogger.Register(startupArgs, false, true); } catch (Exception ex) { System.Console.WriteLine("NLog Exception: " + ex.ToString()); throw; } Bootstrap.Start(args); } catch (ReadarrStartupException ex) { System.Console.WriteLine(""); System.Console.WriteLine(""); Logger.Fatal(ex, "EPIC FAIL!"); Exit(ExitCodes.NonRecoverableFailure, startupArgs); } catch (SocketException ex) { System.Console.WriteLine(""); System.Console.WriteLine(""); Logger.Fatal(ex.Message + ". This can happen if another instance of Readarr is already running another application is using the same port (default: 8787) or the user has insufficient permissions"); Exit(ExitCodes.RecoverableFailure, startupArgs); } catch (IOException ex) { if (ex.InnerException is AddressInUseException) { System.Console.WriteLine(""); System.Console.WriteLine(""); Logger.Fatal(ex.Message + " This can happen if another instance of Readarr is already running another application is using the same port (default: 8787) or the user has insufficient permissions"); Exit(ExitCodes.RecoverableFailure, startupArgs); } else { throw; } } catch (RemoteAccessException ex) { System.Console.WriteLine(""); System.Console.WriteLine(""); Logger.Fatal(ex, "EPIC FAIL!"); Exit(ExitCodes.Normal, startupArgs); } catch (Exception ex) { System.Console.WriteLine(""); System.Console.WriteLine(""); Logger.Fatal(ex, "EPIC FAIL!"); Exit(ExitCodes.UnknownFailure, startupArgs); } Logger.Info("Exiting main."); Exit(ExitCodes.Normal, startupArgs); }
protected NzbDroneMigrationBase() { _logger = NzbDroneLogger.GetLogger(this); }
public RssParser() { _logger = NzbDroneLogger.GetLogger(this); }
public NancyBootstrapper(TinyIoCContainer tinyIoCContainer) { _tinyIoCContainer = tinyIoCContainer; _logger = NzbDroneLogger.GetLogger(); }
protected RssParserBase() { _logger = NzbDroneLogger.GetLogger(this); }
public AppFolderFactory(IAppFolderInfo appFolderInfo, IDiskProvider diskProvider) { _appFolderInfo = appFolderInfo; _diskProvider = diskProvider; _logger = NzbDroneLogger.GetLogger(this); }