Exemplo n.º 1
0
        void Debug(DebugLogMessage message)
        {
            if (!_log.IsDebugEnabled)
            {
                return;
            }

            if (message.Exception != null)
            {
                _log.Debug(message.Message + (message.Exception));
            }
            else
            {
                _log.Debug(message.Message);
            }
        }
Exemplo n.º 2
0
    public List<DebugLogMessage> GetLogMessages(String Language, String UserID, String SearchStr)
    {
        List<DebugLogMessage> LogMessages = new List<DebugLogMessage>();

        string msg = "";

        SqlConnection con = new SqlConnection(
           WebConfigurationManager.ConnectionStrings["iLearnConnectionString"].ConnectionString);

        string sql = "";

        sql = "EXEC [dbo].[GetLogMessages] ";
        sql += "@Language = '{0}',";
        sql += "@UserID = '{1}',";
        sql += "@SearchStr = '{2}'";
        sql = String.Format(sql, Language, UserID, SearchStr);

           SqlCommand cmd = new SqlCommand(sql, con);
           try
           {
          con.Open();
          SqlDataReader reader = cmd.ExecuteReader();
          if (reader.HasRows)
          {
             String DateTime;
             String sUserID;
             String Message;
             while (reader.Read())
             {
                DateTime = reader["DateTime"].ToString();
                sUserID = reader["UserID"].ToString();
                Message = reader["Message"].ToString();
                DebugLogMessage newLogMessage = new DebugLogMessage(DateTime, sUserID, Message);
                LogMessages.Add(newLogMessage);
             }
          }
           }
           catch (SqlException err)
           {
          msg = err.Message;
          con.Close();
           }
           finally
           {
          con.Close();
           }
           return LogMessages;
    }
Exemplo n.º 3
0
        public static void Debug(string text, bool isError = false)
        {
            var message = new DebugLogMessage(text, isError);

            Post(message);
        }
Exemplo n.º 4
0
        public static void Debug(string text)
        {
            var message = new DebugLogMessage(text, false);

            Post(message);
        }