code: function logEvents(flowFn, eventWildcard) {
      if (!flowFn) throw new Error('flowFn is required');
      if (!flowFn.events._loggingEvents) flowFn.events._loggingEvents = [];
      if (eventWildcard === false) { // turn off logging
        flowFn.events._loggingEvents.forEach(function (evt) {
          flowFn.events.removeAllListeners(evt);
        });
        flowFn.events._loggingEvents.length = 0; // clear
      } else if (eventWildcard && eventWildcard !== '*') {
        var logFn = (FLOW_RE.test(eventWildcard)) ? flowLog : taskLog;
        flowFn.events.removeListener(eventWildcard, logFn);
        flowFn.events.on(eventWildcard, logFn);
        flowFn.events._loggingEvents.push(eventWildcard);
      } else { // none provided, use flow.* and task.*
        //output events as tasks start and complete
        flowFn.events.removeListener(ALL_FLOW_EVENTS, flowLog);
        flowFn.events.on(ALL_FLOW_EVENTS, flowLog);
        flowFn.events._loggingEvents.push(ALL_FLOW_EVENTS);
        flowFn.events.removeListener(ALL_TASK_EVENTS, taskLog);
        flowFn.events.on(ALL_TASK_EVENTS, taskLog);
        flowFn.events._loggingEvents.push(ALL_TASK_EVENTS);
      }
    }
docs: Log flow and task events for a flowFn or all of autoflow.
  If called multiple times, remove previous listener (if any) before
  adding.
  
  @example
  var autoflow = require('autoflow');
  autoflow.logEvents(flowFn, eventWildcard); //log events on flowfn matching wildcard
  
  @param flowFn Flow function or global autoflow object
  @param eventWildcard wildcarded event type, if not provided use flow.* and task.*