Beispiel #1
0
 public LogMessage(LogMessageStatus status, string message)
 {
     if (string.IsNullOrWhiteSpace(message))
     {
         throw new ArgumentNullException(nameof(message), "Message can not be empty.");
     }
     Message = message;
     Time    = DateTime.Now;
     Status  = status;
 }
Beispiel #2
0
 public LogMessage(LogMessageStatus status, string message, DateTime time) : this(status, message)
 {
     Time = time;
 }
Beispiel #3
0
        /// <summary>
        /// Creates new log message and logs it using <see cref="Log(ILogMessage)"/>
        /// </summary>
        /// <param name="status">Message status, <see cref="LogMessageStatus"/></param>
        /// <param name="message">Message</param>
        public void Log(LogMessageStatus status, string message)
        {
            ILogMessage msg = new LogMessage(status, message);

            Log(msg);
        }