function logError(socket, myFunc, err) {
  console.error(`WebSSH2 ${prefix(socket)} ERROR: ${myFunc}: ${err}`);
  webssh2debug(socket, `logError: ${myFunc}: ${util.inspect(err)}`);
  if (!socket.request.session) return;
  socket.emit('ssherror', `SSH ${myFunc}: ${err}`);
}
logs error to socket client (if connected)
and console.
@param {object} socket Socket information
@param {string} myFunc Function calling this function
@param {object} err    error object or error message