AjaxLife.AjaxLife.Debug C# (CSharp) Метод

Debug() публичный статический Метод

public static Debug ( string module, string message ) : void
module string
message string
Результат void
        public static void Debug(string module, string message)
        {
            if (AjaxLife.DEBUG_MODE)
            {
                Console.WriteLine("DEBUG [" + module + "]: " + message);
            }
        }

Usage Example

Пример #1
0
 private void UpdateList()
 {
     AjaxLife.Debug("BanList", "Loading ban list from " + AjaxLife.BAN_LIST + "...");
     try
     {
         string sbanlist = "";
         if (AjaxLife.BAN_LIST.StartsWith("http://"))
         {
             HttpWebRequest  request  = (HttpWebRequest)WebRequest.Create(AjaxLife.BAN_LIST);
             HttpWebResponse response = (HttpWebResponse)request.GetResponse();
             StreamReader    reader   = new System.IO.StreamReader(response.GetResponseStream());
             sbanlist = reader.ReadToEnd();
             reader.Close();
             response.Close();
         }
         else
         {
             sbanlist = File.ReadAllText(AjaxLife.BAN_LIST);
         }
         char[] newline = { '\n' };
         this.Bans = sbanlist.Split(newline);
         for (int i = 0; i < this.Bans.Length; ++i)
         {
             this.Bans[i] = this.Bans[i].Trim();
         }
         AjaxLife.Debug("BanList", "Ban list up to date. " + Bans.Length + " banned names.");
     }
     catch (Exception e)
     {
         AjaxLife.Debug("BanList", "Ban list update failed: " + e.Message);
     }
 }
All Usage Examples Of AjaxLife.AjaxLife::Debug