From bd589c194fbb5f16bc3748a276762f92b0ce4185 Mon Sep 17 00:00:00 2001 From: mattreaganmozilla <145381717+mattreaganmozilla@users.noreply.github.com> Date: Fri, 28 Jun 2024 21:41:48 -0700 Subject: [PATCH] Refactor FXIOS-9417 Descriptive debug for Redux Actions #20853 --- BrowserKit/Sources/Redux/Action.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/BrowserKit/Sources/Redux/Action.swift b/BrowserKit/Sources/Redux/Action.swift index 541c2c188761..7bfd183a6ad5 100644 --- a/BrowserKit/Sources/Redux/Action.swift +++ b/BrowserKit/Sources/Redux/Action.swift @@ -6,7 +6,7 @@ import Foundation import Common /// Used to describe an action that can be dispatched by the redux store -open class Action { +open class Action: CustomDebugStringConvertible { public var windowUUID: WindowUUID public var actionType: ActionType @@ -19,6 +19,12 @@ open class Action { let className = String(describing: Self.self) return "\(className) \(actionType)" } + + public var debugDescription: String { + let className = String(describing: type(of: self)) + let memAddr = Unmanaged.passUnretained(self).toOpaque() + return "<\(className): \(memAddr)> Type: \(actionType) Window: \(windowUUID.uuidString.prefix(4))" + } } public protocol ActionType {}