How to use the fancy-log.warn 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 appium / appium-chromedriver / install-npm.js View on Github external
fs.stat(BUILD_PATH, function installScriptExists (err) {
      if (err) {
        // this should only happen on local install
        log.warn(`NOTE: Run 'npx gulp transpile' before using`);
        return;
      }
      require(BUILD_PATH).doInstall().catch(function installError (err) {
        log.error(`Error installing Chromedriver: ${err.message}`);
        log.error(err.stack ? err.stack : err);
        log.error(`Downloading Chromedriver can be skipped by using the ` +
                  `'--chromedriver-skip-install' flag or ` +
                  `setting the 'APPIUM_SKIP_CHROMEDRIVER_INSTALL' environment ` +
                  `variable.`);
        process.exit(1);
      });
    });
  });
github appium / appium-xcuitest-driver / ci / upload-appium.js View on Github external
gulp.task('authenticate', function (done) {
  const githubToken = process.env.GITHUB_TOKEN;

  if (_.isEmpty(githubToken)) {
    log.warn('No GitHub token found in GITHUB_TOKEN environment variable');
    return;
  }

  octokit.authenticate({
    type: 'token',
    token: githubToken,
  });
  done();
});
github angular-material-extensions / google-maps-autocomplete / gulpfile.js View on Github external
result.warnings().forEach(function (warn) {
        fancyLog.warn(warn.toString());
      });
      styleFile = result.css;
github appium / appium-chromedriver / install-npm.js View on Github external
function check () {
    i++;
    try {
      require(BUILD_PATH);
      cb();
    } catch (err) {
      if (err.message.includes(`Cannot find module '${BUILD_PATH}'`)) {
        log.warn(`Project does not appear to be built yet. Please run 'npm run chromedriver' first.`);
        return cb(new Error(`Could not install module: ${err.message}`));
      }
      log.warn(`Error trying to install Chromedriver binary. Waiting ${BUILD_RETRY_INTERVAL}ms and trying again: ${err.message}`);
      if (i <= BUILD_RETRIES) {
        setTimeout(check, BUILD_RETRY_INTERVAL);
      } else {
        cb(new Error(`Could not import installation module: ${err.message}`));
      }
    }
  }
  check();
github v-braun / cocoa-rocks / gulp-compile-data.js View on Github external
request(url, (err, response, body) => {
    if(err) return done(err);

    if(response.statusCode != 200) {
      
      if(response.headers && response.headers['x-ratelimit-remaining'] == 0){
        var limit = response.headers['x-ratelimit-limit'];
        var resetAt = response.headers['x-ratelimit-reset'] * 1000;
        var resetAtDate = new Date(resetAt);
        var diff = resetAtDate - new Date();
        
        log.warn('reached gh rate limit of', limit);
        log.warn('go sleep', diff / 1000 / 60, 'minutes');
        
        setTimeout(() => {
          log.info('awake after sleep');
          getRepoInfo(repo, done);
        }, diff);

        return;
      }
      else{
        return done(new Error('unexpected status code: ' + response.statusCode))
      }
    };

    if(response.statusCode == 200){
      return done(null, JSON.parse(body));
    }
github firebaseui / ng-bootstrap / gulpfile.js View on Github external
result.warnings().forEach(function (warn) {
        fancyLog.warn(warn.toString());
      });
      styleFile = result.css;
github fevrcoding / wok / build / gulp-tasks / watch.js View on Github external
return (done) => {

        const BrowserSync = require('browser-sync');

        const bs = BrowserSync.has(buildHash) ? BrowserSync.get(buildHash) : false;

        options.isWatching = true; //eslint-disable-line no-param-reassign

        const livereload = (d) => {
            bs.reload();
            d();
        };

        if (bs === false) {
            log.warn(cyan('BrowserSync instance not found. Assets live-reload will not be available.'));
        }

        list.forEach(({
            pattern, task, reload, unlink
        }) => {
            const tasks = [task];
            if (reload && bs) {
                tasks.push(livereload);
            }
            const watcher = gulp.watch(normalizePattern(pattern), gulp.series(...tasks));
            if (typeof unlink === 'function') {
                watcher.on('unlink', unlink);
            }

        });
        done();
github yohangz / ornamentum / gulpfile.js View on Github external
result.warnings().forEach(function (warn) {
          log.warn(warn.toString());
        });
        styleFile = result.css;
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;
  }
}

fancy-log

Log things, prefixed with a timestamp.

MIT
Latest version published 3 years ago

Package Health Score

71 / 100
Full package analysis