@@ -14,7 +14,6 @@ struct LogsCustomContentView: View {
14
14
@State private var interval : Double
15
15
@State private var isRepeating : Bool
16
16
@State private var payloadSize : String
17
- @State private var logs : [ String ]
18
17
@State private var isLogging : Bool
19
18
20
19
private let logger : LoggerProtocol
@@ -26,7 +25,6 @@ struct LogsCustomContentView: View {
26
25
interval = 5
27
26
isRepeating = false
28
27
payloadSize = " Small "
29
- logs = [ ]
30
28
isLogging = false
31
29
32
30
logger = Logger . create ( )
@@ -86,14 +84,6 @@ struct LogsCustomContentView: View {
86
84
}
87
85
. listRowBackground ( EmptyView ( ) )
88
86
. listRowInsets ( EdgeInsets ( ) )
89
-
90
- Section ( header: Text ( " Console output: " ) ) {
91
- ForEach ( logs, id: \. self) { log in
92
- Text ( log)
93
- . lineLimit ( nil )
94
- . font ( . footnote)
95
- }
96
- }
97
87
}
98
88
. listSectionSpacing ( 10 )
99
89
}
@@ -105,18 +95,9 @@ struct LogsCustomContentView: View {
105
95
/// - attributes: The payload attributes corresponding to the selected payload size.
106
96
func logBatch( selectedLogLevel: LogLevel , attributes: [ String : Encodable ] ) {
107
97
DispatchQueue . global ( qos: . userInitiated) . async {
108
- var newLogEntries : [ String ] = [ ]
109
-
110
98
for _ in 1 ... self . logsPerBatch {
111
- let logEntry = " \( Date ( ) ) [ \( self . logLevel) ] \( self . logMessage) - \( self . payloadSize) "
112
- newLogEntries. append ( logEntry)
113
-
114
99
self . logger. log ( level: selectedLogLevel, message: self . logMessage, error: nil , attributes: attributes)
115
100
}
116
-
117
- DispatchQueue . main. async {
118
- self . logs. insert ( contentsOf: newLogEntries, at: 0 )
119
- }
120
101
}
121
102
}
122
103
0 commit comments