OSX Launcher: Log all events for debugging

This commit is contained in:
meeh
2018-10-11 11:50:00 +00:00
parent e68182a157
commit 48877079ca

View File

@@ -8,6 +8,8 @@
import Foundation
// TODO: Log all events?
class EventManager {
var listeners = Dictionary<String, NSMutableArray>();
@@ -51,6 +53,7 @@ class EventManager {
// @param eventName: Matching listener eventNames will fire when this is called
// @param information: pass values to your listeners
func trigger(eventName:String, information:Any? = nil) {
print("Event: ", eventName, " will trigger ", self.listeners[eventName]?.count ?? 0, " listeners")
if let actionObjects = self.listeners[eventName] {
for actionObject in actionObjects {
if let actionToPerform = actionObject as? EventListenerAction {