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], choices: [choice],
authenticationBox: authContext.mastodonAuthenticationBox 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 { } 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 // restore voting state
try await managedObjectContext.performChanges { try await managedObjectContext.performChanges {
guard guard
@ -411,10 +408,7 @@ extension StatusTableViewCellDelegate where Self: DataSourceProvider & AuthConte
choices: choices, choices: choices,
authenticationBox: authContext.mastodonAuthenticationBox 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 { } 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 // restore voting state
try await managedObjectContext.performChanges { try await managedObjectContext.performChanges {
guard let poll = poll.object(in: managedObjectContext) else { return } guard let poll = poll.object(in: managedObjectContext) else { return }

View File

@ -15,7 +15,6 @@ import MastodonLocalization
extension UITableViewDelegate where Self: DataSourceProvider & AuthContextProvider { extension UITableViewDelegate where Self: DataSourceProvider & AuthContextProvider {
func aspectTableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 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 { Task {
let source = DataSourceItem.Source(tableViewCell: nil, indexPath: indexPath) let source = DataSourceItem.Source(tableViewCell: nil, indexPath: indexPath)
guard let item = await item(from: source) else { guard let item = await item(from: source) else {
@ -77,7 +76,6 @@ extension UITableViewDelegate where Self: DataSourceProvider & MediaPreviewableV
contextMenuConfigurationForRowAt contextMenuConfigurationForRowAt
indexPath: IndexPath, point: CGPoint indexPath: IndexPath, point: CGPoint
) -> UIContextMenuConfiguration? { ) -> 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 } 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, willPerformPreviewActionForMenuWith configuration: UIContextMenuConfiguration,
animator: UIContextMenuInteractionCommitAnimating 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 configuration = configuration as? TimelineTableViewCellContextMenuConfiguration else { return }
guard let indexPath = configuration.indexPath, let index = configuration.index 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 { protocol DataSourceProvider: NeedsDependency & UIViewController {
var logger: Logger { get }
func item(from source: DataSourceItem.Source) async -> DataSourceItem? func item(from source: DataSourceItem.Source) async -> DataSourceItem?
} }

View File

@ -32,11 +32,6 @@ final class SearchDetailViewModel {
self.authContext = authContext self.authContext = authContext
self.searchText = CurrentValueSubject(initialSearchText) self.searchText = CurrentValueSubject(initialSearchText)
} }
deinit {
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s", ((#file as NSString).lastPathComponent), #line, #function)
}
} }
extension SearchDetailViewModel { extension SearchDetailViewModel {

View File

@ -40,7 +40,6 @@ extension SearchResultViewController: DataSourceProvider {
extension SearchResultViewController { extension SearchResultViewController {
func aspectTableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 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 { Task {
let source = DataSourceItem.Source(tableViewCell: nil, indexPath: indexPath) let source = DataSourceItem.Source(tableViewCell: nil, indexPath: indexPath)
guard let item = await item(from: source) else { guard let item = await item(from: source) else {

View File

@ -14,8 +14,6 @@ import MastodonCore
extension SearchResultViewModel { extension SearchResultViewModel {
class State: GKState { class State: GKState {
let logger = Logger(subsystem: "SearchResultViewModel.State", category: "StateMachine")
let id = UUID() let id = UUID()
weak var viewModel: SearchResultViewModel? weak var viewModel: SearchResultViewModel?
@ -24,22 +22,10 @@ extension SearchResultViewModel {
self.viewModel = viewModel 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 @MainActor
func enter(state: State.Type) { func enter(state: State.Type) {
stateMachine?.enter(state) 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 viewModel.hashtags = hashtags
} catch { } 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) await enter(state: Fail.self)
} }
} // end Task } // end Task