47 lines
1.7 KiB
C#
47 lines
1.7 KiB
C#
using System;
|
|
|
|
namespace XP.Common.Logging.Interfaces
|
|
{
|
|
/// <summary>
|
|
/// 通用日志服务接口(与具体日志框架解耦)| Generic logger service interface (decoupled from specific logging framework)
|
|
/// </summary>
|
|
public interface ILoggerService
|
|
{
|
|
/// <summary>
|
|
/// 调试日志 | Debug log
|
|
/// </summary>
|
|
void Debug(string message, params object[] args);
|
|
|
|
/// <summary>
|
|
/// 信息日志 | Information log
|
|
/// </summary>
|
|
void Info(string message, params object[] args);
|
|
|
|
/// <summary>
|
|
/// 警告日志 | Warning log
|
|
/// </summary>
|
|
void Warn(string message, params object[] args);
|
|
|
|
/// <summary>
|
|
/// 错误日志(带异常)| Error log (with exception)
|
|
/// </summary>
|
|
void Error(Exception ex, string message, params object[] args);
|
|
|
|
/// <summary>
|
|
/// 致命错误日志(带异常)| Fatal error log (with exception)
|
|
/// </summary>
|
|
void Fatal(Exception ex, string message, params object[] args);
|
|
|
|
/// <summary>
|
|
/// 标记日志所属模块(手动指定模块名)| Mark logger module (manually specify module name)
|
|
/// </summary>
|
|
/// <param name="moduleName">模块名称 | Module name</param>
|
|
ILoggerService ForModule(string moduleName);
|
|
|
|
/// <summary>
|
|
/// 标记日志所属模块(自动使用类型全名)| Mark logger module (automatically use type full name)
|
|
/// </summary>
|
|
/// <typeparam name="T">类型参数(自动推断命名空间+类名)| Type parameter (automatically infer namespace + class name)</typeparam>
|
|
ILoggerService ForModule<T>();
|
|
}
|
|
} |