How to use the corvid-local-logger.addSessionData function in corvid-local-logger

To help you get started, we’ve selected a few corvid-local-logger 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 wix-incubator / corvid / packages / corvid-cli / src / cli.js View on Github external
const { killAllChildProcesses } = require("./utils/electron");

notifyOnUpdatedPackages();

// eslint-disable-next-line no-console
console.log(chalk.yellow(getMessage("Cli_Description_Yellow")));
// eslint-disable-next-line no-console
console.log(getMessage("Cli_Description"));
process.on("exit", () => killAllChildProcesses());
process.on("SIGINT", () => killAllChildProcesses());
process.on("SIGTERM", () => killAllChildProcesses());

const fullCommand = process.argv.slice(2).join(" ");

logger.info(`running [${fullCommand}]`);
logger.addSessionData({
  command: process.argv[2],
  fullCommand
});
sessionData.on(["msid", "uuid"], (metasiteId, userId) =>
  logger.addSessionData({ metasiteId, userId })
);

require("yargs")
  .usage("Usage: $0  [options]")
  .commandDir("commands")
  .help("help")
  .strict()
  .demandCommand().argv;