How to use the appium/build/lib/logger.default.info function in appium

To help you get started, we’ve selected a few appium examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cloudgrey-io / appium-grpc / server / index.js View on Github external
let {cmdName, sessionId, urlParams, jsonParams} = call.request;
  try {
    jsonParams = JSON.parse(jsonParams.toString('utf-8'));
  } catch (e) {
    return cb(e);
  }

  if (sessionId) {
    urlParams = [sessionId, ...urlParams];
  }
  urlParams.reverse();
  let res;
  try {
    let jsonParamArgs = Object.keys(jsonParams).map(k => jsonParams[k]);
    const args = [...jsonParamArgs, ...urlParams]
    log.info(`Executing command ${cmdName} with args ${JSON.stringify(args)}`);
    res = await driver.executeCommand(cmdName, ...args);
    if (typeof res.value === 'undefined') {
      res.value = null;
    }
    log.info(`Result: ${JSON.stringify(res.value)}`);
    cb(null, {success: {jsonValue: Buffer.from(JSON.stringify(res.value))}});
  } catch (e) {
    log.error(`Encountered error running command: ${e}`);
    cb(null, {error: {error: e.code, msg: e.message}});
  }
}
github cloudgrey-io / appium-grpc / server / index.js View on Github external
function main () {
  const server = new grpc.Server();
  server.addService(proto.RunCommand.service, {
    run: runCommand
  });
  server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());
  server.start();
  log.info('Server Started');
}