Public NotInheritable Class  CsDebugPrint
    Enum EnDebugType
        System
        ComPort
        Network
        Ftp
    End Enum

    ''' <summary>是否需要打印调试信息</summary>
    Public Shared Property IsDebug As Boolean = True


    ''' <summary>
    ''' 打印调试信息
    ''' </summary>
    ''' <param name="message">需要打印的信息</param>
    Public Shared Sub DebugPrint(message As String)
        If IsDebug Then
            Console.WriteLine(message)
        End If
    End Sub

    ''' <summary>
    ''' 打印调试信息
    ''' </summary>
    ''' <param name="type">打印信息类型</param>
    ''' <param name="msg">需要打印的信息</param>
    Public Shared Sub DebugPrint(type As String, msg As String)
        DebugPrint($"[{type}]{msg}")
    End Sub

    ''' <summary>
    ''' 打印调试信息
    ''' </summary>
    ''' <param name="type">打印信息类型</param>
    ''' <param name="msg">需要打印的信息</param>
    Public Shared Sub DebugPrint(type As EnDebugType, msg As String)
        DebugPrint(type.ToString, msg)
    End Sub

    ''' <summary>
    '''  打印调试信息
    ''' </summary>
    ''' <param name="type">打印信息类型</param>
    ''' <param name="tip">需要打印信息的提示前缀</param>
    ''' <param name="msg">需要打印的信息</param>
    Public Shared Sub DebugPrint(type As String, tip As String, msg As String)
        DebugPrint(type, $"{tip}:{msg}")
    End Sub

    ''' <summary>
    '''  打印调试信息
    ''' </summary>
    ''' <param name="type">打印信息类型</param>
    ''' <param name="tip">需要打印信息的提示前缀</param>
    ''' <param name="msg">需要打印的信息</param>
    Public Shared Sub DebugPrint(type As EnDebugType, tip As String, msg As String)
        DebugPrint(type.ToString, $"{tip}:{msg}")
    End Sub
End Class
