44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
using EonaCat.LogStack.Core;
|
|
using System;
|
|
|
|
namespace EonaCat.LogStack.Logging;
|
|
|
|
// This file is part of the EonaCat project(s) which is released under the Apache License.
|
|
// See the LICENSE file or go to https://EonaCat.com/License for full license details.
|
|
|
|
/// <summary>
|
|
/// Adapter interface that wraps EonaCatLogStack to be compatible with Microsoft.Extensions.Logging.ILogger pattern
|
|
/// </summary>
|
|
public interface ILogger
|
|
{
|
|
/// <summary>
|
|
/// Gets the category/name of this logger
|
|
/// </summary>
|
|
string Category { get; }
|
|
|
|
/// <summary>
|
|
/// Logs a message at the specified log level
|
|
/// </summary>
|
|
void Log(LogLevel level, string message);
|
|
|
|
/// <summary>
|
|
/// Logs a message with an exception at the specified log level
|
|
/// </summary>
|
|
void Log(LogLevel level, Exception exception, string message);
|
|
|
|
/// <summary>
|
|
/// Logs a formatted message at the specified log level
|
|
/// </summary>
|
|
void Log(LogLevel level, string format, params object[] args);
|
|
|
|
/// <summary>
|
|
/// Logs a formatted message with an exception at the specified log level
|
|
/// </summary>
|
|
void Log(LogLevel level, Exception exception, string format, params object[] args);
|
|
|
|
/// <summary>
|
|
/// Checks if the given log level is enabled for this logger
|
|
/// </summary>
|
|
bool IsEnabled(LogLevel level);
|
|
}
|