Example #1
0
        private void findStatus(LogStatus logStatus)
        {
            if (Status == LogStatus.Fatal) return;

            if (logStatus == LogStatus.Fatal)
            {
                Status = logStatus;
                return;
            }

            if (Status == LogStatus.Fail) return;

            if (logStatus == LogStatus.Fail)
            {
                Status = logStatus;
                return;
            }

            if (Status == LogStatus.Error) return;

            if (logStatus == LogStatus.Error)
            {
                Status = logStatus;
                return;
            }

            if (Status == LogStatus.Warning) return;

            if (logStatus == LogStatus.Warning)
            {
                Status = logStatus;
                return;
            }

            if (Status == LogStatus.Pass) return;

            if (logStatus == LogStatus.Pass)
            {
                Status = LogStatus.Pass;
                return;
            }

            if (Status == LogStatus.Skip) return;

            if (logStatus == LogStatus.Skip)
            {
                Status = LogStatus.Skip;
                return;
            }

            if (Status == LogStatus.Info) return;

            if (logStatus == LogStatus.Info)
            {
                Status = LogStatus.Info;
                return;
            }

            Status = LogStatus.Unknown;
        }
Example #2
0
        public static string GetIcon(LogStatus LogStatus)
        {
            if (icon.ContainsKey(LogStatus))
                return icon[LogStatus];

            switch (LogStatus.ToString().ToUpper())
            {
                case "FAIL":
                    return "times-circle-o";
                case "ERROR":
                    return "exclamation-circle";
                case "FATAL":
                    return "exclamation-circle";
                case "PASS":
                    return "check-circle-o";
                case "INFO":
                    return "info-circle";
                case "WARNING":
                    return "warning";
                case "SKIP":
                    return "chevron-circle-right";
                default:
                    return "question";
            }
        }
 private static void LogToFile(string pLog, LogStatus pStatus)
 {
     string LogPath = @"C:\ComCon\Log\Log_" + DateTime.Today.Date + ".txt";
     TextWriter tw = new StreamWriter(LogPath, true);
     tw.Write("[" + pStatus.ToString("G") + "]" + pLog);
     tw.Close();
 }
Example #4
0
 public LogItem(string group, string text, LogStatus status)
 {
     GroupString = group;
     Text = text;
     Time = DateTime.Now;
     Status = status;
 }
Example #5
0
 public LogMessageModel(LogStatus status, string message, int code)
 {
     this._globalID = Guid.NewGuid();
     this._status = status;
     this._message = message;
     this._code = code;
     this._dateCreated = DateTime.UtcNow;
 }
Example #6
0
        internal void TrackLastRunStatus()
        {
            Logs.ForEach(l => findStatus(l.LogStatus));

            if (Status == LogStatus.Info)
            {
                Status = LogStatus.Pass;
            }
        }
Example #7
0
        internal void PrepareFinalize()
        {
            updateTestStatusRecursively(this);

            if (Status == LogStatus.Info)
            {
                Status = LogStatus.Pass;
            }
        }
        /// <summary>
        /// Logs events for the test
        /// 
        /// Log event is shown in the report with 4 columns:
        /// 
        /// <list type="bullet">
        ///     <item>
        ///         <description>Timestamp</description>
        ///     </item>
        ///     <item>
        ///         <description>Status</description>
        ///     </item>
        ///     <item>
        ///         <description>StepName</description>
        ///     </item>
        ///     <item>
        ///         <description>Details</description>
        ///     </item>
        /// </list>
        /// </summary>
        /// 
        /// <param name="Status">Status</param>
        /// <param name="StepName">Name of the step</param>
        /// <param name="Details">Details of the step</param>
        public void Log(LogStatus Status, string StepName, string Details)
        {
            var log = new Log();

            log.Timestamp = DateTime.Now; 
            log.LogStatus = Status;
            log.StepName = StepName;
            log.Details = Details;

            _test.LogList.Add(log);

            _test.TrackLastRunStatus();
            _testStatus = _test.Status;
        }
Example #9
0
 public static string GetIcon(LogStatus Status)
 {
     switch (Enum.GetName(typeof(LogStatus), Status).ToLower())
     {
         case "fail": return "mdi-navigation-cancel";
         case "fatal": return "mdi-navigation-cancel";
         case "error": return "mdi-alert-error";
         case "warning": return "mdi-alert-warning";
         case "pass": return "mdi-action-check-circle";
         case "info": return "mdi-action-info-outline";
         case "skip": return "mdi-av-skip-next";
         default: return "mdi-action-help";
     }
 }
Example #10
0
 public static string GetIcon(LogStatus Status)
 {
     switch (Enum.GetName(typeof(LogStatus), Status).ToLower())
     {
         case "fail": return "times-circle-o";
         case "fatal": return "exclamation-circle";
         case "error": return "exclamation-circle";
         case "warning": return "warning";
         case "pass": return "check-circle-o";
         case "info": return "info-circle";
         case "skip": return "chevron-circle-right";
         default: return "question";
     }
 }
        private void Log(string pText, LogStatus pStatus)
        {
            switch (pStatus)
            {
                case LogStatus.ERROR:
                    textBox1.AppendText("[ERROR] " + pText + "\n");
                    break;
                case LogStatus.INFO:
                    textBox1.AppendText("[INFO] " + pText + "\n");
                    break;
                case LogStatus.WARNING:
                    textBox1.AppendText("[WARNING] " + pText + "\n");
                    break;

            }
            
        }
Example #12
0
        private static void WriteLog(LogStatus logStatus, string message)
        {
            string m_szRunPath = System.Environment.CurrentDirectory.ToString();
            //string m_szRunPath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase);
            if (!(System.IO.Directory.Exists(m_szRunPath + "\\log")))
            {
                System.IO.Directory.CreateDirectory(m_szRunPath + "\\log");
            }

            string strDate = System.DateTime.Now.ToString("yyyyMMdd");

            System.IO.TextWriter tw = new System.IO.StreamWriter(m_szRunPath + "\\log\\Mcms_" + strDate + ".log", true);

            tw.WriteLine(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "   " + (((int)logStatus == 0 ? "info" : (int)logStatus == 1 ? "debug" : (int)logStatus == 2 ? "exception" : (int)logStatus == 3 ? "error" : "") + ": " + message));
            //tw.WriteLine(((int)logStatus == 0 ? "info" : (int)logStatus == 1 ? "debug" : (int)logStatus == 2 ? "exception" : (int)logStatus == 3 ? "error" : "")  + ": " + message);
            //tw.WriteLine("\r\n");
            tw.Close();
        }
Example #13
0
        public static bool TryGetStateFromKey(string key, out LogStatus status)
        {
            if (key == null)
            {
                status = LogStatus.Ok;
                return false;
            }

            // Just take last character.
            char stateChar = key.Last();

            try
            {
                status = (LogStatus)stateChar;
                return true;
            }
            catch (Exception)
            {
                status = LogStatus.Ok;
                return false;
            }
        }
Example #14
0
        public ActionResult Details(Guid iid, long t, LogStatus s)
        {
            var logs = new Logs();
            var instances = new Instances();
            var targets = new Targets();
            var groups = new Groups();

            var log = logs.GetLogEntry(iid, new DateTime(t, DateTimeKind.Utc), s);
            var instance = instances.GetInstance(iid);
            var target = targets.GetTarget(instance.TargetKey);
            var group = groups.GetGroup(target.GroupKey);

            var model = new LogDetails()
            {
                LogEntry = log,
                Instance = instance,
                Target = target,
                Group = group,
            };

            return View(model);
        }
Example #15
0
 private void ElevateStatusTo(LogStatus newStatus)
 {
     if (newStatus > deploymentStatus)
     {
         deploymentStatus = newStatus;
     }
 }
Example #16
0
        private void FindStatus(LogStatus logStatus)
        {
            if (Status == LogStatus.Fatal)
            {
                return;
            }

            if (logStatus == LogStatus.Fatal)
            {
                Status = logStatus;
                return;
            }

            if (Status == LogStatus.Fail)
            {
                return;
            }

            if (logStatus == LogStatus.Fail)
            {
                Status = logStatus;
                return;
            }

            if (Status == LogStatus.Error)
            {
                return;
            }

            if (logStatus == LogStatus.Error)
            {
                Status = logStatus;
                return;
            }

            if (Status == LogStatus.Warning)
            {
                return;
            }

            if (logStatus == LogStatus.Warning)
            {
                Status = logStatus;
                return;
            }

            if (Status == LogStatus.Pass)
            {
                return;
            }

            if (logStatus == LogStatus.Pass)
            {
                Status = LogStatus.Pass;
                return;
            }

            if (Status == LogStatus.Skip)
            {
                return;
            }

            if (logStatus == LogStatus.Skip)
            {
                Status = LogStatus.Skip;
                return;
            }

            if (Status == LogStatus.Info)
            {
                return;
            }

            if (logStatus == LogStatus.Info)
            {
                Status = LogStatus.Info;
                return;
            }

            Status = LogStatus.Unknown;
        }
        /// <summary>
        /// Logs events for the test
        /// 
        /// Log event is shown in the report with 4 columns:
        /// 
        /// <list type="bullet">
        ///     <item>
        ///         <description>Timestamp</description>
        ///     </item>
        ///     <item>
        ///         <description>Status</description>
        ///     </item>
        ///     <item>
        ///         <description>StepName</description>
        ///     </item>
        ///     <item>
        ///         <description>Details of exception</description>
        ///     </item>
        /// </list>
        /// </summary>
        /// 
        /// <param name="Status">Status</param>
        /// <param name="StepName">Name of the step</param>
        /// <param name="Exception">Exception</param>
        public void Log(LogStatus Status, string StepName, Exception Exception)
        {
            this.GetTest().ExceptionList.Add(Exception);

            string details = string.Format("<pre>{0}</pre>", Exception.ToString());

            Log(Status, StepName, details);
        }
 /// <summary>
 /// Logs events for the test
 /// 
 /// Log event is shown in the report with 3 columns:
 /// 
 /// <list type="bullet">
 ///     <item>
 ///         <description>Timestamp</description>
 ///     </item>
 ///     <item>
 ///         <description>Status</description>
 ///     </item>
 ///     <item>
 ///         <description>Details</description>
 ///     </item>
 /// </list>
 /// </summary>
 /// 
 /// <param name="Status">Status</param>
 /// <param name="Details">Details of the step</param>
 public void Log(LogStatus Status, string Details)
 {
     Log(Status, null, Details);
 }
Example #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (HttpContext.Current.Request.Cookies["SNID"] != null)
        {
            LogStatus.DeleteCookies();
        }

        if (LogStatus.IsLoggedIn() <= 0)
        {
            Response.Redirect("home.aspx");
        }

        ou_id = Convert.ToInt32(Request.QueryString["ou_id"]);

        SqlConnection conn = new SqlConnection(@"Data Source=(local)\sqlexpress;Initial Catalog=friendsforever;Integrated Security=True"); //Create Connection

        conn.Open();

        using (SqlCommand command = new SqlCommand("SELECT f_name, l_name, u_name, email FROM users WHERE u_id = @ou_id", conn))
        {
            command.Parameters.AddWithValue("@ou_id", ou_id);
            command.CommandType = CommandType.Text;
            SqlDataReader reader = command.ExecuteReader();

            if (reader.Read())
            {
                f_name = reader["f_name"].ToString();
                l_name = reader["l_name"].ToString();
                u_name = reader["u_name"].ToString();
                email  = reader["email"].ToString();
            }
        }

        conn.Close();

        conn.Open();

        using (SqlCommand command = new SqlCommand("SELECT COUNT(following) AS following FROM follow WHERE following=@ou_id", conn))
        {
            command.Parameters.AddWithValue("@ou_id", ou_id);
            command.CommandType = CommandType.Text;
            SqlDataReader reader = command.ExecuteReader();

            if (reader.Read())
            {
                following = Convert.ToInt32(reader["following"].ToString());
            }
        }

        conn.Close();

        conn.Open();

        using (SqlCommand command = new SqlCommand("SELECT COUNT(being_followed) AS followers FROM follow WHERE being_followed=@ou_id", conn))
        {
            command.Parameters.AddWithValue("@ou_id", ou_id);
            command.CommandType = CommandType.Text;
            SqlDataReader reader = command.ExecuteReader();

            if (reader.Read())
            {
                followers = Convert.ToInt32(reader["followers"].ToString());
            }
        }

        conn.Close();

        conn.Open();

        using (SqlCommand command = new SqlCommand("SELECT following FROM follow WHERE being_followed=@ou_id AND following= @u_id", conn))
        {
            command.Parameters.AddWithValue("@ou_id", ou_id);
            command.Parameters.AddWithValue("@u_id", LogStatus.IsLoggedIn());
            command.CommandType = CommandType.Text;
            SqlDataReader reader = command.ExecuteReader();

            if (reader.Read())
            {
                isFollowing       = true;
                followButton.Text = "Unfollow";
            }
            else
            {
                isFollowing       = false;
                followButton.Text = "Follow";
            }
        }

        conn.Close();
    }
Example #20
0
 public LogException(string message, LogStatus status)
     : base(message)
 {
     this.Status = status;
 }
Example #21
0
 public LogException(string message, LogStatus status, Exception innerException)
     : base(message, innerException)
 {
     this.Status = status;
 }
Example #22
0
 /// <summary>
 /// Logs events for the test
 ///
 /// Log event is shown in the report with 3 columns:
 ///
 /// <list type="bullet">
 ///     <item>
 ///         <description>Timestamp</description>
 ///     </item>
 ///     <item>
 ///         <description>Status</description>
 ///     </item>
 ///     <item>
 ///         <description>Details of exception</description>
 ///     </item>
 /// </list>
 /// </summary>
 ///
 /// <param name="Status">Status</param>
 /// <param name="StepName">Name of the step</param>
 /// <param name="Exception">Exception</param>
 public void Log(LogStatus Status, Exception Exception)
 {
     Log(Status, null, Exception);
 }
Example #23
0
 /// <summary>
 /// Logs events for the test
 ///
 /// Log event is shown in the report with 3 columns:
 ///
 /// <list type="bullet">
 ///     <item>
 ///         <description>Timestamp</description>
 ///     </item>
 ///     <item>
 ///         <description>Status</description>
 ///     </item>
 ///     <item>
 ///         <description>Details</description>
 ///     </item>
 /// </list>
 /// </summary>
 ///
 /// <param name="Status">Status</param>
 /// <param name="Details">Details of the step</param>
 public void Log(LogStatus Status, string Details)
 {
     Log(Status, null, Details);
 }
Example #24
0
        public void TrackLastRunStatus()
        {
            LogList.ForEach(x =>
                {
                    FindStatus(x.LogStatus);
                }
            );

            Status = Status == LogStatus.Info ? LogStatus.Pass : Status;
        }
Example #25
0
 public LogEntry(DateTime time, string message, LogStatus status)
 {
     _Time = time;
     _Message = message;
     _Status = status;
 }
Example #26
0
    protected void followButton_Click(object sender, EventArgs e)
    {
        SqlConnection conn = new SqlConnection(@"Data Source=(local)\sqlexpress;Initial Catalog=friendsforever;Integrated Security=True"); //Create Connection

        conn.Open();

        using (SqlCommand command = new SqlCommand("SELECT * FROM follow WHERE being_followed=@ou_id AND following= @u_id", conn))
        {
            command.Parameters.AddWithValue("@ou_id", ou_id);
            command.Parameters.AddWithValue("@u_id", LogStatus.IsLoggedIn());
            command.CommandType = CommandType.Text;
            SqlDataReader reader = command.ExecuteReader();

            if (reader.Read())
            {
                isFollowing       = true;
                followButton.Text = "Unfollow";
            }
            else
            {
                isFollowing       = false;
                followButton.Text = "Follow";
            }
        }

        conn.Close();


        if (!isFollowing)
        {
            conn.Open();

            using (SqlCommand command = new SqlCommand("INSERT INTO follow VALUES (@following, @being_followed)", conn))
            {
                command.Parameters.AddWithValue("@following", LogStatus.IsLoggedIn());
                command.Parameters.AddWithValue("@being_followed", ou_id);
                command.ExecuteNonQuery();
            }

            conn.Close();

            followButton.Text = "Unfollow";
        }
        else
        {
            conn.Open();

            using (SqlCommand command = new SqlCommand("DELETE FROM follow WHERE following = @following AND being_followed = @being_followed", conn))
            {
                command.Parameters.AddWithValue("@following", LogStatus.IsLoggedIn());
                command.Parameters.AddWithValue("@being_followed", ou_id);
                command.ExecuteNonQuery();
            }

            conn.Close();

            followButton.Text = "Follow";
        }

        Response.Redirect("otherprofiles.aspx?ou_id=" + ou_id);
    }
Example #27
0
        /// <summary>
        /// Logs events for the test
        /// 
        /// Log event is shown in the report with 4 columns:
        /// 
        /// <list type="bullet">
        ///     <item>
        ///         <description>Timestamp</description>
        ///     </item>
        ///     <item>
        ///         <description>Status</description>
        ///     </item>
        ///     <item>
        ///         <description>StepName</description>
        ///     </item>
        ///     <item>
        ///         <description>Details of exception</description>
        ///     </item>
        /// </list>
        /// </summary>
        /// 
        /// <param name="Status">Status</param>
        /// <param name="StepName">Name of the step</param>
        /// <param name="Exception">Exception</param>
        public void Log(LogStatus Status, string StepName, Exception Exception)
        {
            string details = string.Format("<pre>{0}</pre>", Exception.ToString());

            Log(Status, StepName, details);
        }
Example #28
0
 /// <summary>
 /// Creates a new instance of SysEEPLog
 /// </summary>
 /// <param name="clientinfo">Information of client</param>
 /// <param name="style">Log style</param>
 /// <param name="status">Log status</param>
 /// <param name="time">Datetime</param>
 /// <param name="title">Title of log</param>
 /// <param name="description">Description of log</param>
 public SysEEPLog(object[] clientinfo, LogStyle style, LogStatus status, DateTime time, string title, string description)
     : base(INFOREMOTEMODULE_ASSEMBLY, SYSEEPLOG_TYPE, new object[] { clientinfo, style, status, time, title, description })
 {
 }
 /// <summary>
 /// Logs events for the test
 /// 
 /// Log event is shown in the report with 3 columns:
 /// 
 /// <list type="bullet">
 ///     <item>
 ///         <description>Timestamp</description>
 ///     </item>
 ///     <item>
 ///         <description>Status</description>
 ///     </item>
 ///     <item>
 ///         <description>Details of exception</description>
 ///     </item>
 /// </list>
 /// </summary>
 /// 
 /// <param name="Status">Status</param>
 /// <param name="StepName">Name of the step</param>
 /// <param name="Exception">Exception</param>
 public void Log(LogStatus Status, Exception Exception)
 {
     Log(Status, null, Exception);
 }
        /// <summary>
        /// 获取阅览室开闭馆计划,条件为null获取全部
        /// </summary>
        /// <param name="roomNum">阅览室编号</param>
        /// <param name="logstatus">记录状态</param>
        /// <param name="beginDate">记录起始时间</param>
        /// <param name="endDate">记录结束时间</param>
        /// <returns></returns>
        public List <ReadingRoomOpenCloseLogInfo> GetReadingRoomOCLog(string roomNum, LogStatus logstatus, string beginDate, string endDate)
        {
            StringBuilder strWhere = new StringBuilder();

            if (!string.IsNullOrEmpty(roomNum))
            {
                if (String.IsNullOrEmpty(strWhere.ToString()))
                {
                    strWhere.Append(string.Format(" readingRoomNo='{0}'", roomNum));
                }
                else
                {
                    strWhere.Append(string.Format(" and readingRoomNo='{0}'", roomNum));
                }
            }
            if (logstatus != LogStatus.None)
            {
                if (String.IsNullOrEmpty(strWhere.ToString()))
                {
                    strWhere.Append(string.Format(" OpenCloseType='{0}'", (int)logstatus));
                }
                else
                {
                    strWhere.Append(string.Format(" and OpenCloseType='{0}'", (int)logstatus));
                }
            }
            if (string.IsNullOrEmpty(beginDate))
            {
                beginDate = "1900-1-1";
            }
            if (!string.IsNullOrEmpty(endDate))
            {
                if (String.IsNullOrEmpty(strWhere.ToString()))
                {
                    strWhere.Append(string.Format(" OperateTime between '{0}' and '{1}'", beginDate, endDate));
                }
                else
                {
                    strWhere.Append(string.Format(" and OperateTime between '{0}' and '{1}'", beginDate, endDate));
                }
            }

            else
            {
                if (String.IsNullOrEmpty(strWhere.ToString()))
                {
                    strWhere.Append(string.Format(" (OperateTime between '{0}' and '{1}')", beginDate, GetServerDateTime().ToString()));
                }
                else
                {
                    strWhere.Append(string.Format(" and (OperateTime between '{0}' and '{1}')", beginDate, GetServerDateTime().ToString()));
                }
            }
            List <ReadingRoomOpenCloseLogInfo> list = new List <ReadingRoomOpenCloseLogInfo>();

            try
            {
                DataSet ds = t_sm_rropencloselog.GetList(strWhere.ToString(), null);
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    list.Add(DataRowToReadingRoomOpenCloseLogInfo(ds.Tables[0].Rows[i]));
                }
                return(list);
            }
            catch
            {
                throw;
            }
        }
Example #31
0
        /// <summary>
        /// Logs events for the test
        /// </summary>
        /// <param name="LogStatus">LogStatus</param>
        /// <param name="StepName">Name of the step</param>
        /// <param name="Details">Step details</param>
        public void Log(LogStatus LogStatus, string StepName, string Details)
        {
            Log evt = new Log();

            evt.Timestamp = DateTime.Now;
            evt.LogStatus = LogStatus;
            evt.StepName = StepName;
            evt.Details = Details;

            test.Logs.Add(evt);

            TrackLastRunStatus(LogStatus);
        }
Example #32
0
 public JSONFormatter(string userEmail, LogStatus status)
 {
     _userEmail = userEmail;
     _status    = status;
 }
Example #33
0
        private void UpdateReportStatus(LogStatus logStatus)
        {
            if (_reportStatus == LogStatus.Fatal) return;

            if (logStatus == LogStatus.Fatal)
            {
                _reportStatus = logStatus;
                return;
            }

            if (_reportStatus == LogStatus.Fail) return;

            if (logStatus == LogStatus.Fail)
            {
                _reportStatus = logStatus;
                return;
            }

            if (_reportStatus == LogStatus.Error) return;

            if (logStatus == LogStatus.Error)
            {
                _reportStatus = logStatus;
                return;
            }

            if (_reportStatus == LogStatus.Warning) return;

            if (logStatus == LogStatus.Warning)
            {
                _reportStatus = logStatus;
                return;
            }

            if (_reportStatus == LogStatus.Pass) return;

            if (logStatus == LogStatus.Pass)
            {
                _reportStatus = LogStatus.Pass;
                return;
            }

            if (_reportStatus == LogStatus.Skip) return;

            if (logStatus == LogStatus.Skip)
            {
                _reportStatus = LogStatus.Skip;
                return;
            }

            if (_reportStatus == LogStatus.Info) return;

            if (logStatus == LogStatus.Info)
            {
                _reportStatus = LogStatus.Info;
                return;
            }

            _reportStatus = LogStatus.Unknown;
        }
Example #34
0
 /// <summary>
 /// Logs events for the test
 /// </summary>
 /// <param name="LogStatus">LogStatus</param>
 /// <param name="Details">Step details</param>
 public void Log(LogStatus LogStatus, string Details)
 {
     Log(LogStatus, "", Details);
 }
Example #35
0
 public static void Override(LogStatus LogStatus, string Icon)
 {
     icon.Add(LogStatus, Icon);
 }
Example #36
0
        private void TrackLastRunStatus(LogStatus LogStatus)
        {
            if (runStatus == LogStatus.Unknown)
            {
                if (LogStatus == LogStatus.Info)
                {
                    runStatus = LogStatus.Pass;
                }
                else
                {
                    runStatus = LogStatus;
                }

                return;
            }

            if (runStatus == LogStatus.Fatal) return;

            if (LogStatus == LogStatus.Fatal)
            {
                runStatus = LogStatus;
                return;
            }

            if (runStatus == LogStatus.Fail) return;

            if (LogStatus == LogStatus.Fail)
            {
                runStatus = LogStatus;
                return;
            }

            if (runStatus == LogStatus.Error) return;

            if (LogStatus == LogStatus.Error)
            {
                runStatus = LogStatus;
                return;
            }

            if (runStatus == LogStatus.Warning) return;

            if (LogStatus == LogStatus.Warning)
            {
                runStatus = LogStatus;
                return;
            }

            if (runStatus == LogStatus.Pass || runStatus == LogStatus.Info)
            {
                runStatus = LogStatus.Pass;
                return;
            }

            runStatus = LogStatus.Skip;
        }
 public static void Log(string pLog, LogStatus pStatus)
 {
     LogEvent(null, new LoggingEventArgs() { LogString = pLog, Status = pStatus });
 }
Example #38
0
 public LogEntry GetLogEntry(Guid instanceKey, DateTime timestamp, LogStatus status)
 {
     try
     {
         using (var client = new AmazonS3Client(Context.AwsAccessKeyId, Context.AwsSecretAccessKey))
         {
             using (var res = client.GetObject(new GetObjectRequest()
             {
                 BucketName = Context.BucketName,
                 Key = GetInstanceLogEntryPath(instanceKey, timestamp, status),
             }))
             {
                 using (var stream = res.ResponseStream)
                 {
                     return new LogEntry(stream);
                 }
             }
         }
     }
     catch (AmazonS3Exception awsEx)
     {
         if (awsEx.StatusCode == System.Net.HttpStatusCode.NotFound)
         {
             throw new LogEntryNotFoundException(string.Format("Could not find the log entry at timestamp {0} for instance with key: {1}", timestamp, instanceKey), awsEx);
         }
         else
         {
             throw new DeploymentException(string.Format("Failed getting the log entry at timestamp {0} for instance with key: {1}", timestamp, instanceKey), awsEx);
         }
     }
 }
Example #39
0
 public static string GetInstanceLogEntryPath(Guid instanceKey, DateTime entryTimestamp, LogStatus status)
 {
     return string.Format("{0}/{1}/{2}-{3}", STR_LOGS_CONTAINER_PATH, instanceKey.ToString("N"), Serialisation.SerialiseDateReversed(entryTimestamp), (char)status);
 }
Example #40
0
 public LogInfoArgs(LogStatus status, string text)
 {
     Status  = status;
     Message = text;
 }