コード例 #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;
 }
コード例 #2
0
 public LogMessage(LogMessageStatus status, string message, DateTime time) : this(status, message)
 {
     Time = time;
 }
コード例 #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);
        }