diff --git a/DarockBili Watch App/DarockBiliApp.swift b/DarockBili Watch App/DarockBiliApp.swift index ae97b44c6..da58b5024 100644 --- a/DarockBili Watch App/DarockBiliApp.swift +++ b/DarockBili Watch App/DarockBiliApp.swift @@ -25,7 +25,9 @@ import SDWebImageSVGCoder import SDWebImageWebPCoder //!!!: Debug Setting, Set false Before Release -var debug = false +var debug = true + +var debugControlStdout = "stdo\n" var pShowTipText = "" var pShowTipSymbol = "" @@ -174,14 +176,20 @@ struct DarockBili_Watch_AppApp: App { .buttonStyle(.plain) .offset(x: 15, y: 5) if isShowingDebugControls { - HStack { - VStack { + VStack { + HStack { Text("Memory Usage: \(memoryUsage) MB") - + Spacer() + } + .allowsHitTesting(false) + ScrollView { + Text(debugControlStdout) } - .font(.system(size: 10)) - Spacer() + .frame(height: 180) + .border(Color.blue, width: 2) } + .font(.system(size: 10)) + .onAppear { Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { timer in systemResourceRefreshTimer = timer diff --git a/DarockBili Watch App/InMain/SearchView.swift b/DarockBili Watch App/InMain/SearchView.swift index 9ac87a1e0..e1708ec6c 100644 --- a/DarockBili Watch App/InMain/SearchView.swift +++ b/DarockBili Watch App/InMain/SearchView.swift @@ -133,6 +133,7 @@ struct SearchView: View { debugResponse = "" DarockKit.Network.shared.requestJSON("https://api.bilibili.com/x/frontend/finger/spi") { respJson, isSuccess in if isSuccess { + debugControlStdout += "SEARCH/FINGER/SPI SUCCEEDED: \n\(respJson.debugDescription)" let headers: HTTPHeaders = [ "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9", "accept-encoding": "gzip, deflate, br", @@ -151,6 +152,7 @@ struct SearchView: View { DarockKit.Network.shared.requestJSON("https://api.bilibili.com/x/web-interface/wbi/search/all/v2?\(signed)", headers: headers) { respJson, isSuccess in if isSuccess { debugPrint(respJson) + debugControlStdout += "SEARCH/ALL/V2 SUCCEEDED: \n\(respJson.debugDescription)" let userDatas = respJson["data"]["result"][8]["data"] for user in userDatas { isUserDetailPresented.append(false)