mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Remove the createSpan method entirely
As it's easier to live without it than to deal with the API redesign or or misuse panics.
This commit is contained in:
@@ -94,12 +94,6 @@ nonisolated extension URL {
|
||||
}
|
||||
|
||||
var globalProxy: String? {
|
||||
let span = MXLog.createSpan("Global proxy")
|
||||
span.enter()
|
||||
defer {
|
||||
span.exit()
|
||||
}
|
||||
|
||||
guard let proxySettings = CFNetworkCopySystemProxySettings()?.takeRetainedValue() else {
|
||||
MXLog.error("Failed retrieving proxy settings")
|
||||
return nil
|
||||
|
||||
@@ -23,14 +23,6 @@ nonisolated enum MXLog {
|
||||
rootSpan.enter()
|
||||
}
|
||||
|
||||
static func createSpan(_ name: String,
|
||||
file: String = #file,
|
||||
function: String = #function,
|
||||
line: Int = #line,
|
||||
column: Int = #column) -> Span {
|
||||
createSpan(name, level: .info, file: file, function: function, line: line, column: column)
|
||||
}
|
||||
|
||||
static func verbose(_ message: Any,
|
||||
file: String = #file,
|
||||
function: String = #function,
|
||||
@@ -112,20 +104,6 @@ nonisolated enum MXLog {
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
// periphery:ignore:parameters function,column
|
||||
private static func createSpan(_ name: String,
|
||||
level: LogLevel,
|
||||
file: String = #file,
|
||||
function: String = #function,
|
||||
line: Int = #line,
|
||||
column: Int = #column) -> Span {
|
||||
if Span.current().isNone() {
|
||||
rootSpan.enter()
|
||||
}
|
||||
|
||||
return Span(file: file, line: UInt32(line), level: level.rustLogLevel, target: currentTarget, name: name, bridgeTraceId: nil)
|
||||
}
|
||||
|
||||
// periphery:ignore:parameters function,column
|
||||
private static func log(_ message: Any,
|
||||
level: LogLevel,
|
||||
|
||||
@@ -251,15 +251,6 @@ class RoomSummaryProvider: RoomSummaryProviderProtocol {
|
||||
return currentItems
|
||||
}
|
||||
|
||||
// The span guard is thread local, so it must not straddle a suspension
|
||||
// point, otherwise the task could resume on a different thread and
|
||||
// unbalance it, causing a panic and subsequent (intentional) crash.
|
||||
let span = MXLog.createSpan("\(name).apply_room_list_diff")
|
||||
span.enter()
|
||||
defer {
|
||||
span.exit()
|
||||
}
|
||||
|
||||
guard let updatedItems = currentItems.applying(collectionDiff) else {
|
||||
MXLog.error("\(name): Failed applying diff: \(collectionDiff)")
|
||||
return currentItems
|
||||
|
||||
@@ -99,12 +99,6 @@ class TimelineItemProvider: TimelineItemProviderProtocol {
|
||||
private static func processDiffs(_ diffs: [TimelineDiff],
|
||||
on currentItems: [TimelineItemProxy],
|
||||
spanName: String) async -> (itemProxies: [TimelineItemProxy], hasMembershipChange: Bool) {
|
||||
let span = MXLog.createSpan(spanName)
|
||||
span.enter()
|
||||
defer {
|
||||
span.exit()
|
||||
}
|
||||
|
||||
var hasMembershipChange = false
|
||||
|
||||
let itemProxies = diffs.reduce(currentItems) { currentItems, diff in
|
||||
|
||||
Reference in New Issue
Block a user