void Run() { AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException; if (Environment.UserInteractive) { SensuClient.Start(); Console.CancelKeyPress += delegate { _log.Info("Cancel Key Pressed. Shutting Down."); }; } else { var servicesToRun = new ServiceBase[] { new SensuClient() }; ServiceBase.Run(servicesToRun); } }
static void Main() { _log = LogManager.GetCurrentClassLogger(); #if DEBUG LogManager.GlobalThreshold = LogLevel.Trace; #endif AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException; if (Environment.UserInteractive) { SensuClient.Start(); Console.CancelKeyPress += delegate { _log.Info("Cancel Key Pressed. Shutting Down."); }; } else { var servicesToRun = new ServiceBase[] { new SensuClient() }; ServiceBase.Run(servicesToRun); } }