public static void Main(string[] args) { commandLineOptions = ParseCommandLine(args); if (commandLineOptions != null) { if (commandLineOptions.RequestToken) { logger.Warn("Please visit following uri to retrieve your Slack token"); logger.Warn(OAuthHelper.GetAuthorizationUri()); } else { luxa4Slack = new Luxa4Slack( commandLineOptions.Token, commandLineOptions.ShowUnreadMentions, commandLineOptions.ShowUnreadMessages); try { luxa4Slack.Initialize(); luxa4Slack.LuxaforFailure += OnLuxaforFailure; Console.ReadLine(); } catch (Exception ex) { logger.Error(ex); } finally { luxa4Slack.Dispose(); } } } }
private static CommandLineOptions ParseCommandLineResults(CommandLineOptions options) { if (options.Debug) { foreach (var rule in LogManager.Configuration.LoggingRules) { rule.EnableLoggingForLevels(LogLevel.Trace, LogLevel.Fatal); } LogManager.ReconfigExistingLoggers(); } return options; }