Remove some logs while figuring out how search works (IOS-141)

This commit is contained in:
Nathan Mattes 2023-09-14 16:51:39 +02:00
parent 2b7aa652c9
commit 0fa75fc1d3
6 changed files with 0 additions and 31 deletions

View File

@ -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 }

View File

@ -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 }

View File

@ -45,6 +45,5 @@ extension DataSourceItem {
}
protocol DataSourceProvider: NeedsDependency & UIViewController {
var logger: Logger { get }
func item(from source: DataSourceItem.Source) async -> DataSourceItem?
}

View File

@ -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 {

View File

@ -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 {

View File

@ -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