''' <summary>
''' ログを出力する。[Information]
''' </summary>
''' <param name="msg">出力メッセージ</param>
''' <param name="useBuffer">バッファの利用有無</param>
''' <remarks></remarks>
Public Sub OutputInfo( _
ByVal msg As String, _
Optional ByVal useBuffer As Boolean = False)
Call OutputLog("Informaton", msg, useBuffer)
End Sub
''' <summary>
''' ログを出力する。[Warning]
''' </summary>
''' <param name="msg">出力メッセージ</param>
''' <param name="useBuffer">バッファの利用有無</param>
''' <remarks></remarks>
Public Sub OutputWarn( _
ByVal msg As String, _
Optional ByVal useBuffer As Boolean = False)
Call OutputLog("Warning", msg, useBuffer)
End Sub
''' <summary>
''' ログを出力する。[Error]
''' </summary>
''' <param name="msg">出力メッセージ</param>
''' <param name="objErr">エラーオブジェクト</param>
''' <param name="useBuffer">バッファの利用有無</param>
''' <remarks></remarks>
Public Sub OutputError( _
ByVal msg As String, _
Optional ByVal objErr As ErrObject = Nothing, _
Optional ByVal useBuffer As Boolean = False)
Dim strMsg As String
strMsg = msg
If Not (objErr Is Nothing) Then
strMsg = strMsg & ":" & _
"Err.Number:[" & objErr.Number & "]," & _
"Err.Description:[" & objErr.Description & "]:"
End If
Call OutputLog("Error", strMsg, useBuffer)
End Sub
''' <summary>
''' ログを出力する。
''' </summary>
''' <param name="logType">ログ種別</param>
''' <param name="msg">出力メッセージ</param>
''' <param name="useBuffer">バッファの利用有無</param>
''' <remarks></remarks>
Private Sub OutputLog( _
ByVal logType As String, _
ByVal msg As String, _
ByVal useBuffer As Boolean)
''' <summary>
''' ログ出力ディレクトリを取得する。
''' </summary>
''' <returns>ログ出力ディレクトリ(デフォルト:ThisWorkbook.path)</returns>
''' <remarks></remarks>
Private Function GetLogDirectory() As String
If Me.LogDirectory = "" Then
GetLogDirectory = ThisWorkbook.Path
Exit Function
End If
GetLogDirectory = Me.LogDirectory
End Function
''' <summary>
''' バッファーをクリアする。
''' </summary>
''' <remarks></remarks>
Public Sub ClearLog()
Dim i As Long
For i = colTraget.Count To 1 Step -1
colTraget.Remove i
Next