Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create interface ILogger and IActionLogger #32

Merged
merged 1 commit into from Jan 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
55 changes: 55 additions & 0 deletions src/WordTutor.Core/Logging/ILogger.cs
@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace WordTutor.Core.Logging
{
public interface ILogger
{
/// <summary>
/// Log the start of an action
/// </summary>
/// <remarks>
/// Disposable so that the end of the action can be captured.
/// </remarks>
/// <param name="message">
/// Description of the action to be performed.
/// </param>
IActionLogger Action(string message);

/// <summary>
/// Log info information about the application
/// </summary>
/// <param name="message">
/// Information to be logged.
/// </param>
void Info(string message);

/// <summary>
/// Log debug information about the application
/// </summary>
/// <param name="message">
/// Information to be logged.
/// </param>
void Debug(string message);
}

public interface IActionLogger : ILogger, IDisposable
{
/// <summary>
/// Indicate that the current action (or part thereof) has been successful
/// </summary>
/// <param name="message">
/// Information about the successful outcome.
/// </param>
void Success(string message);

/// <summary>
/// Indicate that the current action (or part thereof) has failed
/// </summary>
/// <param name="message">
/// Information about the failure
/// </param>
void Failure(string message);
}
}