[feat]网络层增加Byte[]和ArraySegment的发送重载,直达底层,这是用户最常用的方法,也是性能最好的路径。
大石头 authored at 2024-11-19 10:06:42
1.68 KiB
X
#nullable enable
namespace NewLife.Log;

/// <summary>日志接口</summary>
/// <remarks>
/// 文档 https://newlifex.com/core/log
/// </remarks>
public interface ILog
{
    /// <summary>写日志</summary>
    /// <param name="level">日志级别</param>
    /// <param name="format">格式化字符串</param>
    /// <param name="args">格式化参数</param>
    void Write(LogLevel level, String format, params Object?[] args);

    /// <summary>调试日志</summary>
    /// <param name="format">格式化字符串</param>
    /// <param name="args">格式化参数</param>
    void Debug(String format, params Object?[] args);

    /// <summary>信息日志</summary>
    /// <param name="format">格式化字符串</param>
    /// <param name="args">格式化参数</param>
    void Info(String format, params Object?[] args);

    /// <summary>警告日志</summary>
    /// <param name="format">格式化字符串</param>
    /// <param name="args">格式化参数</param>
    void Warn(String format, params Object?[] args);

    /// <summary>错误日志</summary>
    /// <param name="format">格式化字符串</param>
    /// <param name="args">格式化参数</param>
    void Error(String format, params Object?[] args);

    /// <summary>严重错误日志</summary>
    /// <param name="format">格式化字符串</param>
    /// <param name="args">格式化参数</param>
    void Fatal(String format, params Object?[] args);

    /// <summary>是否启用日志</summary>
    Boolean Enable { get; set; }

    /// <summary>日志等级,只输出大于等于该级别的日志,默认Info</summary>
    LogLevel Level { get; set; }
}
#nullable restore