   }
   
   public func setState(_ state: StateType) {
-    if debugMode { NSLog("FSM Set state \(state)") }
+    if debugMode { NSLog("FSM(\(name ?? "?")) SetState \(state)") }
+    
     let definition = definedState(state)!
     definition.state = state
     

  }
  
  public func event(_ event: EventType) {
    if debugMode { NSLog("FSM Event: \(event)") }
    lastEvent = event
    guard let aTransition = transitions.filter({ $0.event == event && $0.state == state }).first else {
      if debugMode { NSLog("No transition for \(event)@\(state) in \(self.transitions)") }
      return
    }
    
    guard let targetState = aTransition.target() else {
      if debugMode { NSLog("No target state!") }
      return
    }
    

    transitions.append(StateTransition(event: event, state: state, target: target))
  }
  
  public func transition(on event: EventType, from states: [StateType], to target: @escaping @autoclosure () -> StateType?) {
    for state in states {
      transitions.append(StateTransition(event: event, state: state, target: target))
    }
  }
  
  public func transition(on event: EventType, from state: StateType, with target: @escaping () -> StateType?) {
    transitions.append(StateTransition(event: event, state: state, target: target))
  }
