Beispiel #1
0
 public static void WriteLine(Logging.LogSeverity severity, string format, params object[] values)
 {
     if (null == _logger)
     {
         return;
     }
     _logger.WriteLine(severity, format, values);
 }
Beispiel #2
0
        public LogChannel(String channelName, Logging.LogSeverity severity, Color color)
        {
            _ChannelName     = channelName;
            _ChannelSeverity = severity;
            _ChannelColor    = color;

            ChannelId = Logging.RegisterLoggingChannel(channelName, severity, color);
        }
Beispiel #3
0
 public static void WriteLine(Logging.LogSeverity severity, string message)
 {
     // Do nothing if we have not been setup
     if (null == _logger)
     {
         return;
     }
     _logger.WriteLine(severity, message);
 }
Beispiel #4
0
        private void UIForm_Load(object sender, EventArgs e)
        {
            UpdateLockUI();
            UpdateStudents();
            UpdateCategory();
            UpdateWinners();
            UpdateOptions();
            UpdateManualVote();
            SetLocalIP(); // must come after options since it relies on it

            // These may error in execution:
            UpdateCurrentQueue();
            UpdateCurrentlyVoting();

            this.tabControl1_SelectedIndexChanged(this.tabControl1, null);


            try
            {
                WebServer = new ServerUI.WebsiteHandler();
            }
            catch { }

            if (Program.Github == null)
            {
                if (!warnedGithubBefore)
                {
                    warnedGithubBefore = true;
                    if (string.IsNullOrWhiteSpace(Options.Github_AuthToken))
                    {
                        Logging.Log(Logging.LogSeverity.Error, "Github authentication token is empty.");
                        Logging.Log(Logging.LogSeverity.Error, "Bug reporting will be disableld.");
                    }
                    else
                    {
                        Github              = new GithubDLL.GithubClient(Options.Github_AuthToken, "tgc-awards");
                        Github.RequestMade += (object sendert, GithubDLL.RESTRequestEventArgs args) =>
                        {
                            bool success            = (int)args.ResponseCode >= 200 && (int)args.ResponseCode <= 299;
                            Logging.LogSeverity sev = success ? Logging.LogSeverity.Debug : Logging.LogSeverity.Warning;
                            Logging.Log(sev, args.ToString(), "GithubREST");
                        };
                        Program.AwardsRepository = Github.GetRepository("thegrandcoding", "awardsserver");
                        LoadBugs();
                        UpdateBugReports();
                    }
                }
            }
            else
            {
                UpdateBugReports();
            }
        }
Beispiel #5
0
 public void SetChannelSeverity(Logging.LogSeverity severity)
 {
     _ChannelSeverity = severity;
     Logging.SetLoggingLevel(ChannelId, severity);
 }
Beispiel #6
0
 public void Log(Color color, String msg, Logging.LogSeverity severity = Logging.LogSeverity.LS_MESSAGE)
 {
     Logging.Log(ChannelId, severity, color, msg);
 }