seb-win-refactoring/SafeExamBrowser.Contracts/Logging/ILogger.cs

79 lines
2.2 KiB
C#
Raw Normal View History

2017-07-05 11:41:19 +02:00
/*
* Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET)
2017-07-05 11:41:19 +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 System.Collections.Generic;
namespace SafeExamBrowser.Contracts.Logging
2017-07-05 11:41:19 +02:00
{
/// <summary>
/// Defines the functionality of the logger.
/// </summary>
public interface ILogger
2017-07-05 11:41:19 +02:00
{
/// <summary>
/// Logs the given message with severity <see cref="LogLevel.Debug"/>.
/// </summary>
/// <exception cref="ArgumentNullException" />
void Debug(string message);
/// <summary>
/// Logs the given message with severity <see cref="LogLevel.Info"/>.
/// </summary>
/// <exception cref="ArgumentNullException" />
void Info(string message);
/// <summary>
/// Logs the given message with severity <see cref="LogLevel.Warning"/>.
/// </summary>
/// <exception cref="ArgumentNullException" />
void Warn(string message);
/// <summary>
/// Logs the given message with severity <see cref="LogLevel.Error"/>.
/// </summary>
/// <exception cref="ArgumentNullException" />
void Error(string message);
/// <summary>
/// Logs the given message with severity <see cref="LogLevel.Error"/> and includes
/// information about the specified exception (i.e. type, message and stacktrace).
/// </summary>
/// <exception cref="ArgumentNullException" />
void Error(string message, Exception exception);
/// <summary>
/// Logs the given message as raw text.
/// </summary>
/// <exception cref="ArgumentNullException" />
void Log(string message);
/// <summary>
/// Appends the given content to the log.
/// </summary>
/// <exception cref="ArgumentNullException" />
void Log(ILogContent content);
/// <summary>
/// Subscribes an observer to the application log.
/// </summary>
/// <exception cref="ArgumentNullException" />
void Subscribe(ILogObserver observer);
/// <summary>
/// Unsubscribes an observer from the application log.
/// </summary>
void Unsubscribe(ILogObserver observer);
/// <summary>
/// Returns a copy of the current log content.
/// </summary>
IList<ILogContent> GetLog();
2017-07-05 11:41:19 +02:00
}
}