Changeset 69 for Include/Classes/System/Diagnostics/Trace.ab
- Timestamp:
- Jan 19, 2007, 3:34:12 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Include/Classes/System/Diagnostics/Trace.ab
r66 r69 1 1 2 2 Class Trace 3 Static indentLevel = 0 As Long 4 Static indentSize = 4 As Long 5 6 7 ' リスナ管理 8 Static Listeners As TraceListenerCollection 3 Static base As _System_TraceBase() 9 4 10 5 Public … … 16 11 ' アサート(コールスタックを表示) 17 12 Static Sub Assert( condition As Boolean ) 18 If condition == False then 19 'TODO: コールスタックを表示 20 End If 13 base.Assert( condition ) 21 14 End Sub 22 15 23 16 ' アサート(メッセージ文字列を表示) 24 17 Static Sub Assert( condition As Boolean, message As String ) 25 If condition == False then 26 ' TODO: メッセージボックス形式での表示に対応 27 WriteLine( message ) 28 End If 18 base.Assert( condition, message ) 29 19 End Sub 30 20 31 21 ' アサート(メッセージ文字列と詳細文字列を表示) 32 22 Static Sub Assert( condition As Boolean, message As String, detailMessage As String ) 33 If condition == False then 34 ' TODO: メッセージボックス形式での表示に対応 35 WriteLine( message ) 36 End If 23 base.Assert( condition, message, detailMessage ) 37 24 End Sub 38 25 … … 40 27 ' インデントレベルを上げる 41 28 Static Sub Indent() 42 IndentLevel = indentLevel + 129 base.Indent() 43 30 End Sub 44 31 45 32 ' インデントレベルを下げる 46 33 Static Sub Unindent() 47 If indentLevel <= 0 Then 48 indentLevel = 0 49 Return 50 End If 51 IndentLevel = indentLevel - 1 34 base.Unindent() 52 35 End Sub 53 36 37 ' 文字列を出力 38 Static Sub Write( value As Object ) 39 base.Write( value ) 40 End Sub 54 41 Static Sub Write( message As String ) 55 42 base.Write( message ) 43 End Sub 44 Static Sub Write( value As Object, category As String ) 45 base.Write( value, category ) 46 End Sub 47 Static Sub Write( message As String, category As String ) 48 base.Write( message, category ) 56 49 End Sub 57 50 58 51 ' 一行の文字列を出力 52 Static Sub WriteLine( value As Object ) 53 base.WriteLine( value ) 54 End Sub 59 55 Static Sub WriteLine( message As String ) 60 Dim i As Long 61 For i = 0 To ELM( Listeners.Count ) 62 Dim temp As TraceListener 63 temp = Listeners[i] 64 temp.WriteLine( message ) 65 Next 56 base.WriteLine( message ) 57 End Sub 58 Static Sub WriteLine( value As Object, category As String ) 59 base.WriteLine( value, category ) 60 End Sub 61 Static Sub WriteLine( message As String, category As String ) 62 base.WriteLine( message, category ) 63 End Sub 64 65 ' 条件をもとに文字列を出力 66 Static Sub WriteIf( condition As Boolean, value As Object ) 67 base.WriteIf( condition, value ) 68 End Sub 69 Static Sub WriteIf( condition As Boolean, message As String ) 70 base.WriteIf( condition, message ) 71 End Sub 72 Static Sub WriteIf( condition As Boolean, value As Object, category As String ) 73 base.WriteIf( condition, value, category ) 74 End Sub 75 Static Sub WriteIf( condition As Boolean, message As String, category As String ) 76 base.WriteIf( condition, message, category ) 77 End Sub 78 79 ' 条件をもとに一行の文字列を出力 80 Static Sub WriteLineIf( condition As Boolean, message As String ) 81 base.WriteLineIf( condition, message ) 82 End Sub 83 Static Sub WriteLineIf( condition As Boolean, value As Object ) 84 base.WriteLineIf( condition, value ) 85 End Sub 86 Static Sub WriteLineIf( condition As Boolean, value As Object, category As String ) 87 base.WriteLineIf( condition, value, category ) 88 End Sub 89 Static Sub WriteLineIf( condition As Boolean, message As String, category As String ) 90 base.WriteLineIf( condition, message, category ) 66 91 End Sub 67 92 … … 73 98 ' IndentLevelプロパティ 74 99 Static Function IndentLevel() As Long 75 Return indentLevel100 Return base.IndentLevel 76 101 End Function 77 102 Static Sub IndentLevel( indentLevel As Long ) 78 This.indentLevel = indentLevel 79 80 Dim i As Long 81 For i = 0 To ELM( Listeners.Count ) 82 Dim temp As TraceListener 83 temp = Listeners[i] 84 temp.IndentLevel = indentLevel 85 Next 103 base.IndentLevel = indentLevel 86 104 End Sub 87 105 88 106 ' IndentSizeプロパティ 89 107 Static Function IndentSize() As Long 90 Return indentSize108 Return base.IndentSize 91 109 End Function 92 110 Static Sub IndentSize( size As Long ) 93 indentSize = size 94 95 Dim i As Long 96 For i = 0 To ELM( Listeners.Count ) 97 Dim temp As TraceListener 98 temp = Listeners[i] 99 temp.IndentSize = indentSize 100 Next 111 base.IndentSize = size 101 112 End Sub 102 113 114 ' Listenersプロパティ 115 Static Function Listeners() As TraceListenerCollection 116 Return base.Listeners 117 End Function 118 103 119 End Class 104 105 Dim _System_defaultTraceListener As DefaultTraceListener106 Trace.Listeners.Add( _System_defaultTraceListener )
Note:
See TracChangeset
for help on using the changeset viewer.