How to use the @parcel/logger.persistent function in @parcel/logger

To help you get started, we’ve selected a few @parcel/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 mattdesl / fika / src / fika.js View on Github external
function printLogMessage (slug, urls, defaultPort, port) {
    let portMatches = port === defaultPort;
    urls = urls
      .map(u => chalk.bold(chalk.cyan(u)))
      .map(u => `    ${u}`)
      .join('\n');

    const portMsg = portMatches ? '' : chalk.red(`ERROR: Port ${defaultPort} is in use, using ${chalk.cyan(port)} instead\n`)
    const msg = `Development server for ${chalk.magenta(slug)} running at:`
    logger.persistent(`${portMsg}${chalk.bold(msg)}

${urls}

Enter Ctrl + C in your shell to stop the server.\n`);
  }