How to use the @parcel/logger.info 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 parcel-bundler / parcel / packages / core / package-manager / src / Yarn.js View on Github external
.on('data', (message: YarnStdOutMessage) => {
        switch (message.type) {
          case 'step':
            logger.progress(
              prefix(
                `[${message.data.current}/${message.data.total}] ${message.data.message}`,
              ),
            );
            return;
          case 'success':
          case 'info':
            logger.info({
              origin: '@parcel/package-manager',
              message: prefix(message.data),
            });
            return;
          default:
          // ignore
        }
      });
github parcel-bundler / parcel / packages / core / workers / src / index.js View on Github external
bus.on('logEvent', (e: LogEvent) => {
    switch (e.level) {
      case 'info':
        invariant(typeof e.message === 'string');
        Logger.info(e.message);
        break;
      case 'progress':
        invariant(typeof e.message === 'string');
        Logger.progress(e.message);
        break;
      case 'verbose':
        invariant(typeof e.message === 'string');
        Logger.verbose(e.message);
        break;
      case 'warn':
        Logger.warn(e.message);
        break;
      case 'error':
        Logger.error(e.message);
        break;
      default:
github parcel-bundler / parcel / packages / reporters / loc / src / LOCReporter.js View on Github external
async report(event: ReporterEvent, options: ParcelOptions) {
    let logLevelFilter = options.logLevel || 'info';

    if (
      event.type !== 'buildSuccess' ||
      LOG_LEVELS[logLevelFilter] < LOG_LEVELS.info
    ) {
      return;
    }

    event.bundleGraph.getBundles();
    Logger.info(
      'Number of lines: ' + (await lineCounter(event.bundleGraph.getBundles()))
    );
  }
});
github parcel-bundler / parcel / packages / core / workers / src / WorkerFarm.js View on Github external
var profiles = await Promise.all(promises);
    let trace = new Trace();
    let filename = `profile-${profileId++}.trace`;
    let stream = trace.pipe(fs.createWriteStream(filename));

    for (let profile of profiles) {
      trace.addCPUProfile(names.shift(), profile);
    }

    trace.flush();
    await new Promise(resolve => {
      stream.once('finish', resolve);
    });

    logger.info({
      origin: '@parcel/workers',
      message: `Wrote profile to ${filename}`,
    });
  }