int main(string[] args) { // NB: Trying to delete the app directory while we have Setup.log // open will actually crash the uninstaller bool isUninstalling = args.Any(x => x.Contains("uninstall")); // Uncomment to test Gifs //AnimatedGifWindow.ShowWindow(TimeSpan.FromMilliseconds(0), animatedGifWindowToken.Token); //Thread.Sleep(10 * 60 * 1000); using (var logger = new SetupLogLogger(isUninstalling) { Level = LogLevel.Info }) { Locator.CurrentMutable.Register(() => logger, typeof(Splat.ILogger)); try { return(executeCommandLine(args)); } catch (Exception ex) { logger.Write("Unhandled exception: " + ex, LogLevel.Fatal); throw; } // Ideally we would deregister the logger from the Locator before it was disposed - this is a hazard as it is at the moment } }
int main(string[] args) { try { opt = new StartupOption(args); } catch (Exception ex) { using (var logger = new SetupLogLogger(true, "OptionParsing") { Level = LogLevel.Info }) { Locator.CurrentMutable.Register(() => logger, typeof(Splat.ILogger)); logger.Write($"Failed to parse command line options. {ex.Message}", LogLevel.Error); } throw; } // NB: Trying to delete the app directory while we have Setup.log // open will actually crash the uninstaller bool isUninstalling = opt.updateAction == UpdateAction.Uninstall; using (var logger = new SetupLogLogger(isUninstalling, opt.updateAction.ToString()) { Level = LogLevel.Info }) { Locator.CurrentMutable.Register(() => logger, typeof(Splat.ILogger)); try { return(executeCommandLine(args)); } catch (Exception ex) { logger.Write("Finished with unhandled exception: " + ex, LogLevel.Fatal); throw; } } }
int main(string[] args) { using (var logger = new SetupLogLogger() {Level = LogLevel.Info}) { Locator.CurrentMutable.Register(() => logger, typeof (Splat.ILogger)); try { return executeCommandLine(args, logger.LogPath); } catch (Exception ex) { logger.Write("Unhandled exception: " + ex, LogLevel.Fatal); throw; } // Ideally we would deregister the logger from the Locator before it was disposed - this is a hazard as it is at the moment } }
int main(string[] args) { using (var logger = new SetupLogLogger() { Level = LogLevel.Info }) { Locator.CurrentMutable.Register(() => logger, typeof(Splat.ILogger)); try { return(executeCommandLine(args, logger.LogPath)); } catch (Exception ex) { logger.Write("Unhandled exception: " + ex, LogLevel.Fatal); throw; } // Ideally we would deregister the logger from the Locator before it was disposed - this is a hazard as it is at the moment } }
int main(string[] args) { // NB: Trying to delete the app directory while we have Setup.log // open will actually crash the uninstaller bool isUninstalling = args.Any(x => x.Contains("uninstall")); using (var logger = new SetupLogLogger(isUninstalling) {Level = LogLevel.Info}) { Locator.CurrentMutable.Register(() => logger, typeof (Splat.ILogger)); try { return executeCommandLine(args); } catch (Exception ex) { logger.Write("Unhandled exception: " + ex, LogLevel.Fatal); throw; } } }
int main(string[] args) { // NB: Trying to delete the app directory while we have Setup.log // open will actually crash the uninstaller bool isUninstalling = args.Any(x => x.Contains("uninstall")); // Uncomment to test Gifs //AnimatedGifWindow.ShowWindow(TimeSpan.FromMilliseconds(0), animatedGifWindowToken.Token); //Thread.Sleep(10 * 60 * 1000); using (var logger = new SetupLogLogger(isUninstalling) {Level = LogLevel.Info}) { Locator.CurrentMutable.Register(() => logger, typeof (Splat.ILogger)); try { return executeCommandLine(args); } catch (Exception ex) { logger.Write("Unhandled exception: " + ex, LogLevel.Fatal); throw; } // Ideally we would deregister the logger from the Locator before it was disposed - this is a hazard as it is at the moment } }