Remove some logs while figuring out how search works (IOS-141)
This commit is contained in:
parent
2b7aa652c9
commit
0fa75fc1d3
|
@ -352,10 +352,7 @@ extension StatusTableViewCellDelegate where Self: DataSourceProvider & AuthConte
|
|||
choices: [choice],
|
||||
authenticationBox: authContext.mastodonAuthenticationBox
|
||||
)
|
||||
logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): vote poll for \(choice) success")
|
||||
} catch {
|
||||
logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): vote poll fail: \(error.localizedDescription)")
|
||||
|
||||
// restore voting state
|
||||
try await managedObjectContext.performChanges {
|
||||
guard
|
||||
|
@ -411,10 +408,7 @@ extension StatusTableViewCellDelegate where Self: DataSourceProvider & AuthConte
|
|||
choices: choices,
|
||||
authenticationBox: authContext.mastodonAuthenticationBox
|
||||
)
|
||||
logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): vote poll for \(choices) success")
|
||||
} catch {
|
||||
logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): vote poll fail: \(error.localizedDescription)")
|
||||
|
||||
// restore voting state
|
||||
try await managedObjectContext.performChanges {
|
||||
guard let poll = poll.object(in: managedObjectContext) else { return }
|
||||
|
|
|
@ -15,7 +15,6 @@ import MastodonLocalization
|
|||
extension UITableViewDelegate where Self: DataSourceProvider & AuthContextProvider {
|
||||
|
||||
func aspectTableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): indexPath: \(indexPath.debugDescription)")
|
||||
Task {
|
||||
let source = DataSourceItem.Source(tableViewCell: nil, indexPath: indexPath)
|
||||
guard let item = await item(from: source) else {
|
||||
|
@ -77,7 +76,6 @@ extension UITableViewDelegate where Self: DataSourceProvider & MediaPreviewableV
|
|||
contextMenuConfigurationForRowAt
|
||||
indexPath: IndexPath, point: CGPoint
|
||||
) -> UIContextMenuConfiguration? {
|
||||
logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public)")
|
||||
|
||||
guard let cell = tableView.cellForRow(at: indexPath) as? StatusViewContainerTableViewCell else { return nil }
|
||||
|
||||
|
@ -238,7 +236,6 @@ extension UITableViewDelegate where Self: DataSourceProvider & MediaPreviewableV
|
|||
willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration,
|
||||
animator: UIContextMenuInteractionCommitAnimating
|
||||
) {
|
||||
logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public)")
|
||||
|
||||
guard let configuration = configuration as? TimelineTableViewCellContextMenuConfiguration else { return }
|
||||
guard let indexPath = configuration.indexPath, let index = configuration.index else { return }
|
||||
|
|
|
@ -45,6 +45,5 @@ extension DataSourceItem {
|
|||
}
|
||||
|
||||
protocol DataSourceProvider: NeedsDependency & UIViewController {
|
||||
var logger: Logger { get }
|
||||
func item(from source: DataSourceItem.Source) async -> DataSourceItem?
|
||||
}
|
||||
|
|
|
@ -32,11 +32,6 @@ final class SearchDetailViewModel {
|
|||
self.authContext = authContext
|
||||
self.searchText = CurrentValueSubject(initialSearchText)
|
||||
}
|
||||
|
||||
deinit {
|
||||
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension SearchDetailViewModel {
|
||||
|
|
|
@ -40,7 +40,6 @@ extension SearchResultViewController: DataSourceProvider {
|
|||
|
||||
extension SearchResultViewController {
|
||||
func aspectTableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): indexPath: \(indexPath.debugDescription)")
|
||||
Task {
|
||||
let source = DataSourceItem.Source(tableViewCell: nil, indexPath: indexPath)
|
||||
guard let item = await item(from: source) else {
|
||||
|
|
|
@ -14,8 +14,6 @@ import MastodonCore
|
|||
extension SearchResultViewModel {
|
||||
class State: GKState {
|
||||
|
||||
let logger = Logger(subsystem: "SearchResultViewModel.State", category: "StateMachine")
|
||||
|
||||
let id = UUID()
|
||||
|
||||
weak var viewModel: SearchResultViewModel?
|
||||
|
@ -24,22 +22,10 @@ extension SearchResultViewModel {
|
|||
self.viewModel = viewModel
|
||||
}
|
||||
|
||||
override func didEnter(from previousState: GKState?) {
|
||||
super.didEnter(from: previousState)
|
||||
|
||||
let from = previousState.flatMap { String(describing: $0) } ?? "nil"
|
||||
let to = String(describing: self)
|
||||
logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): \(from) -> \(to)")
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func enter(state: State.Type) {
|
||||
stateMachine?.enter(state)
|
||||
}
|
||||
|
||||
deinit {
|
||||
logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): [\(self.id.uuidString)] \(String(describing: self))")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -165,7 +151,6 @@ extension SearchResultViewModel.State {
|
|||
viewModel.hashtags = hashtags
|
||||
|
||||
} catch {
|
||||
logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public): search \(searchText) fail: \(error.localizedDescription)")
|
||||
await enter(state: Fail.self)
|
||||
}
|
||||
} // end Task
|
||||
|
|
Loading…
Reference in New Issue