2017-07-06 18:18:39 +02:00
|
|
|
|
/*
|
2019-01-09 11:25:21 +01:00
|
|
|
|
* Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET)
|
2017-07-06 18:18:39 +02:00
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using SafeExamBrowser.Contracts.Logging;
|
|
|
|
|
|
2018-08-31 10:06:27 +02:00
|
|
|
|
namespace SafeExamBrowser.Logging
|
2017-07-06 18:18:39 +02:00
|
|
|
|
{
|
2018-03-06 14:35:10 +01:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Default implementation of <see cref="ILogMessage"/>.
|
|
|
|
|
/// </summary>
|
2017-10-10 15:44:04 +02:00
|
|
|
|
public class LogMessage : ILogMessage
|
2017-07-06 18:18:39 +02:00
|
|
|
|
{
|
|
|
|
|
public DateTime DateTime { get; private set; }
|
|
|
|
|
public LogLevel Severity { get; private set; }
|
|
|
|
|
public string Message { get; private set; }
|
2017-07-10 15:47:12 +02:00
|
|
|
|
public IThreadInfo ThreadInfo { get; private set; }
|
2017-07-06 18:18:39 +02:00
|
|
|
|
|
2017-07-10 15:47:12 +02:00
|
|
|
|
public LogMessage(DateTime dateTime, LogLevel severity, string message, IThreadInfo threadInfo)
|
2017-07-06 18:18:39 +02:00
|
|
|
|
{
|
|
|
|
|
DateTime = dateTime;
|
|
|
|
|
Severity = severity;
|
|
|
|
|
Message = message;
|
2017-07-12 15:36:30 +02:00
|
|
|
|
ThreadInfo = threadInfo ?? throw new ArgumentNullException(nameof(threadInfo));
|
2017-07-06 18:18:39 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public object Clone()
|
|
|
|
|
{
|
2017-07-10 15:47:12 +02:00
|
|
|
|
return new LogMessage(DateTime, Severity, Message, ThreadInfo.Clone() as IThreadInfo);
|
2017-07-06 18:18:39 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|