logEvent (eventName) {
    if (eventName === "commands") {
      throw new Error("Cannot log commands directly");
    }
    if (typeof eventName !== "string") {
      throw new Error(`Invalid eventName ${eventName}`);
    }
    if (!this._eventHistory[eventName]) {
      this._eventHistory[eventName] = [];
    }
    let ts = Date.now();
    let logTime = (new Date(ts)).toTimeString();
    this._eventHistory[eventName].push(ts);
    log.debug(`Event '${eventName}' logged at ${ts} (${logTime})`);
  }
/*
   * API method for driver developers to log timings for important events
   */
API method for driver developers to log timings for important events
API method for driver developers to log timings for important events
logEvent (eventName) {
    if (eventName === "commands") {
      throw new Error("Cannot log commands directly");
    }
    if (typeof eventName !== "string") {
      throw new Error(`Invalid eventName ${eventName}`);
    }
    if (!this._eventHistory[eventName]) {
      this._eventHistory[eventName] = [];
    }
    let ts = Date.now();
    let logTime = (new Date(ts)).toTimeString();
    this._eventHistory[eventName].push(ts);
    log.debug(`Event '${eventName}' logged at ${ts} (${logTime})`);
  }
logEvent ( eventName ) { if ( eventName === "commands" ) { throw new Error ( "Cannot log commands directly" ) ; } if ( typeof eventName !== "string" ) { throw new Error ( ` ${ eventName } ` ) ; } if ( ! this . _eventHistory [ eventName ] ) { this . _eventHistory [ eventName ] = [ ] ; } let ts = Date . now ( ) ; let logTime = ( new Date ( ts ) ) . toTimeString ( ) ; this . _eventHistory [ eventName ] . push ( ts ) ; log . debug ( ` ${ eventName } ${ ts } ${ logTime } ` ) ; }
API method for driver developers to log timings for important events
API method for driver developers to log timings for important events