using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nappat.Testing
{
    public class LogLine
    {
        public DateTime Time { get; set; }
        public string Category { get; set; }
        public string Severity { get; set; }
        public string Message { get; set; }
        public string Data { get; set; }

        public LogLine(string time, string category, string severity, string message, string data)
        {
            if (time == null)
                this.Time = DateTime.Now;
            else
                this.Time = Convert.ToDateTime(time);
            this.Category = category;
            this.Severity = severity;
            this.Message = message;
            this.Data = data;
        }

        public LogLine()
        {
            this.Time = DateTime.Now;
            this.Category = null;
            this.Severity = null;
            this.Message = null;
            this.Data = null;
        }

        public override string ToString()
        {
            string retString = this.Time.ToString("HH:mm:ss") + ": " +
                this.Category + ": " +
                    this.Severity + ": " +
                        this.Message + ": " +
                            this.Data;
            return retString;
        }
    }
}
