[fix]修正UdpServer在接收广播时连续启动接收的错误,在StarAgent中,此时可能收到广播包,SocketFlags是Broadcast,需要清空,否则报错“参考的对象类型不支持尝试的操作”; 无需设置SocketOptionName.PacketInformation,在ReceiveMessageFromAsync时会自动设置,并且支持ipv6;
石头 authored at 2024-10-10 00:36:00 石头 committed at 2024-10-10 00:45:43
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