Add memory address to Fiber.debugDescription

This commit is contained in:
Carson Katri 2022-06-30 09:35:31 -04:00
parent 28e6583469
commit f2720fa304
1 changed files with 3 additions and 2 deletions

View File

@ -17,12 +17,13 @@
extension FiberReconciler.Fiber: CustomDebugStringConvertible { extension FiberReconciler.Fiber: CustomDebugStringConvertible {
public var debugDescription: String { public var debugDescription: String {
let memoryAddress = String(format: "%010p", unsafeBitCast(self, to: Int.self))
if case let .view(view, _) = content, if case let .view(view, _) = content,
let text = view as? Text let text = view as? Text
{ {
return "Text(\"\(text.storage.rawText)\")" return "Text(\"\(text.storage.rawText)\") (\(memoryAddress))"
} }
return "\(typeInfo?.name ?? "Unknown")" return "\(typeInfo?.name ?? "Unknown") (\(memoryAddress))"
} }
private func flush(level: Int = 0) -> String { private func flush(level: Int = 0) -> String {