mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Add developer options for Rust's Trace Log Packs. (#3929)
* Add support for configuring log packs. * Update call widget parameters. * Update the SDK.
This commit is contained in:
+22
@@ -21,6 +21,14 @@ struct DeveloperOptionsScreen: View {
|
||||
Form {
|
||||
Section("Logging") {
|
||||
LogLevelConfigurationView(logLevel: $context.logLevel)
|
||||
|
||||
DisclosureGroup("SDK trace packs") {
|
||||
ForEach(TraceLogPack.allCases, id: \.self) { pack in
|
||||
Toggle(isOn: $context.traceLogPacks[pack]) {
|
||||
Text(pack.title)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Section("General") {
|
||||
@@ -153,6 +161,20 @@ private struct LogLevelConfigurationView: View {
|
||||
}
|
||||
}
|
||||
|
||||
private extension Set<TraceLogPack> {
|
||||
/// A custom subscript that allows binding a toggle to add/remove a pack from the array.
|
||||
subscript(pack: TraceLogPack) -> Bool {
|
||||
get { contains(pack) }
|
||||
set {
|
||||
if newValue {
|
||||
insert(pack)
|
||||
} else {
|
||||
remove(pack)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Previews
|
||||
|
||||
struct DeveloperOptionsScreen_Previews: PreviewProvider {
|
||||
|
||||
Reference in New Issue
Block a user