2017-07-05 11:41:19 +02:00
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2017 ETH Zürich, Educational Development and Technology (LET)
|
|
|
|
|
*
|
|
|
|
|
* 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/.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-07-07 15:46:32 +02:00
|
|
|
|
using System;
|
2017-07-05 17:21:52 +02:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
2017-07-06 18:18:39 +02:00
|
|
|
|
namespace SafeExamBrowser.Contracts.Logging
|
2017-07-05 11:41:19 +02:00
|
|
|
|
{
|
2017-07-06 18:18:39 +02:00
|
|
|
|
public interface ILogger
|
2017-07-05 11:41:19 +02:00
|
|
|
|
{
|
2017-07-12 15:36:30 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Logs the given message with severity <b>INFO</b>.
|
|
|
|
|
/// </summary>
|
2017-07-06 18:18:39 +02:00
|
|
|
|
void Info(string message);
|
2017-07-12 15:36:30 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Logs the given message with severity <b>WARNING</b>.
|
|
|
|
|
/// </summary>
|
2017-07-06 18:18:39 +02:00
|
|
|
|
void Warn(string message);
|
2017-07-12 15:36:30 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Logs the given message with severity <b>ERROR</b>.
|
|
|
|
|
/// </summary>
|
2017-07-06 18:18:39 +02:00
|
|
|
|
void Error(string message);
|
2017-07-12 15:36:30 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Logs the given message with severity <b>ERROR</b> and includes information about
|
|
|
|
|
/// the specified exception (i.e. type, message and stacktrace).
|
|
|
|
|
/// </summary>
|
2017-07-07 15:46:32 +02:00
|
|
|
|
void Error(string message, Exception exception);
|
2017-07-12 15:36:30 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Logs the given message as raw text.
|
|
|
|
|
/// </summary>
|
2017-07-07 15:46:32 +02:00
|
|
|
|
void Log(string message);
|
2017-07-12 15:36:30 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Appends the given content to the log.
|
|
|
|
|
/// </summary>
|
2017-07-07 15:46:32 +02:00
|
|
|
|
void Log(ILogContent content);
|
2017-07-12 15:36:30 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Suscribes an observer to the application log.
|
|
|
|
|
/// </summary>
|
2017-07-06 18:18:39 +02:00
|
|
|
|
void Subscribe(ILogObserver observer);
|
2017-07-12 15:36:30 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Unsubscribes an observer from the application log.
|
|
|
|
|
/// </summary>
|
2017-07-06 18:18:39 +02:00
|
|
|
|
void Unsubscribe(ILogObserver observer);
|
2017-07-12 15:36:30 +02:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns a copy of the current log content.
|
|
|
|
|
/// </summary>
|
2017-07-07 15:46:32 +02:00
|
|
|
|
IList<ILogContent> GetLog();
|
2017-07-05 11:41:19 +02:00
|
|
|
|
}
|
|
|
|
|
}
|