How to use the fancy-log.error function in fancy-log

To help you get started, we’ve selected a few fancy-log 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 angeloanan / MPC-DiscordRPC / index.js View on Github external
mediaEmitter.on('CONN_ERROR', code => {
	log.error(`ERROR: Unable to connect to Media Player Classic on port ${config.port}. ` +
		`Make sure MPC is running, Web Interface is enabled and the port set in 'config.js' file is correct.\n` + code);
	// If MPC was previously connected (ie. MPC gets closed while script is running)
	// the whole process is killed and restarted by Forever in order to clean MPC Rich Presence
	// from user's profile, as destroyRPC() apparently can't do so.
	if (active) {
		log.warn('WARN: Killing process to clean Rich Presence from your profile...');
		process.exit(0);
	}
	if (mpcServerLoop._onTimeout !== checkMPCEndpoint) {
		clearInterval(mpcServerLoop);
		mpcServerLoop = setInterval(checkMPCEndpoint, 15000);
	}
});
github nestjs / nest / tools / gulp / tasks / samples.ts View on Github external
async function buildSamples() {
  const directories = getDirs(samplePath);

  for await (const dir of directories) {
    const dirName = dir.replace(__dirname, '');
    log.info(`Building ${clc.magenta(dirName)}`);
    try {
      await exec(`npm run build --prefix ${dir}`);
      log.info(`Finished building ${clc.magenta(dirName)}`);
    } catch (err) {
      log.error(`Failed building ${clc.magenta(dirName)}:`);
      if (err.stdout) {
        log.error(err.stdout);
      }
      process.exit(1);
    }
  }
}
github aditosoftware / nodepki / server.js View on Github external
.catch(function(error){
        log.error("Could not start OCSP server: " + error);
    });
github pine / Miyako / lib / slack_bot.js View on Github external
async onMessage(message) {
    try {
      const ts = parseFloat(message.ts) * 1000

      if (this.startedAt > ts) return
      if (typeof message.subtype === 'string') return

      const channel = this.slackChannelResolver.resolve(message.channel)
      await Promise.all([
        this.processConfluence({ message, channel }),
        this.processJira({ message, channel }),
      ])
    } catch (e) {
      log.error(e)
    }
  }
github aditosoftware / nodepki / api / certificate.js View on Github external
.catch(function(err){
                                log.error("Could not re-index CertDB.");
                            });
                        });
github aquariuslt / vue-boilerplate / tasks / build.js View on Github external
webpack(webpackProdConfig, function(error, stats) {
    if (error || stats.hasErrors()) {
      log.error('Webpack build error:', error);
    }
    log.info(stats.toString(webpackProdConfig.stats));
    log.info('Webpack build done');
    done();
  });
});
github appium / appium / gulpfile.js View on Github external
gulp.task('fixShrinkwrap', function fixShrinkwrap (done) {
  let shrinkwrap;
  try {
    shrinkwrap = require('./npm-shrinkwrap.json');
  } catch (err) {
    log.error('Could not find shrinkwrap; skipping fixing shrinkwrap. ' +
              `(Original error: ${err.message})`);
    return done();
  }

  delete shrinkwrap.dependencies.fsevents;
  const shrinkwrapString = JSON.stringify(shrinkwrap, null, '  ') + '\n';
  fs.writeFile('./npm-shrinkwrap.json', shrinkwrapString, done);
});
github pine / Miyako / lib / slack_bot.js View on Github external
async onAuthenticated(message) {
    log(`${this.domain} -> authenticated`)

    try {
      const teamInfo = await this.web.team.info()
      delete teamInfo['team']['icon']
      log(`${this.domain} -> ${JSON.stringify(teamInfo.team)}`)
    } catch (e) {
      log.error(e)
    }
  }
github ampproject / amphtml / build-system / tasks / visual-diff / helpers.js View on Github external
function log(mode, ...messages) {
  switch (mode) {
    case 'verbose':
      if (isTravisBuild()) {
        return;
      }
      fancyLog.info(colors.green('VERBOSE:'), ...messages);
      break;
    case 'info':
      fancyLog.info(colors.green('INFO:'), ...messages);
      break;
    case 'warning':
      fancyLog.warn(colors.yellow('WARNING:'), ...messages);
      break;
    case 'error':
      fancyLog.error(colors.red('ERROR:'), ...messages);
      break;
    case 'fatal':
      process.exitCode = 1;
      fancyLog.error(colors.red('FATAL:'), ...messages);
      throw new Error(messages.join(' '));
    case 'travis':
      if (isTravisBuild()) {
        messages.forEach(message => process.stdout.write(message));
      }
      break;
  }
}
github Netflix / unleash / lib / deploy.js View on Github external
NPM.publish(function (pubError) {
            if (pubError) {
              log.error('Publish failed, your changelog may get in an undefined state :(')
              log.error(pubError)
              throw pubError
            }
          })
        })

fancy-log

Log things, prefixed with a timestamp.

MIT
Latest version published 3 years ago

Package Health Score

71 / 100
Full package analysis