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; }
public LogMessage(LogMessageStatus status, string message, DateTime time) : this(status, message) { Time = time; }
/// <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); }