How to use gulplog - 10 common examples

To help you get started, we’ve selected a few gulplog 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 gulpjs / gulp-cli / index.js View on Github external
logVerify(blacklisted);
    });
  }

  if (!env.modulePath) {
    /* istanbul ignore next */
    var missingNodeModules =
      fs.existsSync(path.join(env.cwd, 'package.json'))
      && !fs.existsSync(path.join(env.cwd, 'node_modules'));

    /* istanbul ignore next */
    var missingGulpMessage =
      missingNodeModules
        ? 'Local modules not found in'
        : 'Local gulp not found in';
    log.error(
      ansi.red(missingGulpMessage),
      ansi.magenta(tildify(env.cwd))
    );
    /* istanbul ignore next */
    var installCommand =
      missingNodeModules
        ? 'npm install'
        : 'npm install gulp';
    log.error(ansi.red('Try running: ' + installCommand));
    exit(1);
  }

  if (!env.configPath) {
    log.error(ansi.red('No gulpfile found'));
    exit(1);
  }
github gulpjs / gulp-cli / lib / versioned / ^4.0.0 / log / events.js View on Github external
gulpInst.on('error', function(evt) {
    var msg = formatError(evt);
    var time = prettyTime(evt.duration);
    var level = evt.branch ? 'debug' : 'error';
    log[level](
      '\'' + ansi.cyan(evt.name) + '\'',
      ansi.red('errored after'),
      ansi.magenta(time)
    );

    // If we haven't logged this before, log it and add to list
    if (loggedErrors.indexOf(evt.error) === -1) {
      log.error(msg);
      loggedErrors.push(evt.error);
    }
  });
}
github gulpjs / gulp-cli / index.js View on Github external
cli.on('requireFail', function(name, error) {
  log.warn(
    ansi.yellow('Failed to load external module'),
    ansi.magenta(name)
  );
  /* istanbul ignore else */
  if (error) {
    log.warn(ansi.yellow(error.toString()));
  }
});
github gulpjs / gulp-cli / index.js View on Github external
cli.on('requireFail', function(name, error) {
  log.warn(
    ansi.yellow('Failed to load external module'),
    ansi.magenta(name)
  );
  /* istanbul ignore else */
  if (error) {
    log.warn(ansi.yellow(error.toString()));
  }
});
github gulpjs / gulp-cli / test / fixtures / logging.js View on Github external
var log = require('gulplog');
var yargs = require('yargs');
var toConsole = require('../../lib/shared/log/to-console');
var cliOptions = require('../../lib/shared/cli-options');

var parser = yargs.usage('', cliOptions);
var opts = parser.argv;

toConsole(log, opts);

log.debug('test debug');
log.info('test info');
log.warn('test warn');
log.error('test error');
github gulpjs / gulp-cli / lib / versioned / ^4.0.0-alpha.2 / index.js View on Github external
tree = gulpInst.tree({ deep: true });
      if (config.description && typeof config.description === 'string') {
        tree.label = config.description;
      } else {
        tree.label = 'Tasks for ' + tildify(env.configPath);
      }

      var output = JSON.stringify(copyTree(tree, opts));

      if (typeof opts.tasksJson === 'boolean' && opts.tasksJson) {
        return console.log(output);
      }
      return fs.writeFileSync(opts.tasksJson, output, 'utf-8');
    }
    try {
      log.info('Using gulpfile', color.highlight(tildify(env.configPath)));
      gulpInst.parallel(toRun)(function(err) {
        if (err) {
          exit(1);
        }
      });
    } catch (err) {
      log.error(color.error(err.message));
      log.error('To list available tasks, try running: gulp --tasks');
      exit(1);
    }
  });
}
github gulpjs / gulp-cli / lib / versioned / ^4.0.0-alpha.1 / index.js View on Github external
tree = {};
      if (config.description && typeof config.description === 'string') {
        tree.label = config.description;
      } else {
        tree.label = 'Tasks for ' + tildify(env.configPath);
      }
      tree.nodes = gulpInst.tree({ deep: true });

      var output = JSON.stringify(copyTree(tree, opts));
      if (typeof opts.tasksJson === 'boolean' && opts.tasksJson) {
        return console.log(output);
      }
      return fs.writeFileSync(opts.tasksJson, output, 'utf-8');
    }
    try {
      log.info('Using gulpfile', color.highlight(tildify(env.configPath)));
      gulpInst.parallel(toRun)(function(err) {
        if (err) {
          exit(1);
        }
      });
    } catch (err) {
      log.error(color.error(err.message));
      log.error('To list available tasks, try running: gulp --tasks');
      exit(1);
    }
  });
}
github gulpjs / gulp-cli / lib / versioned / ^4.0.0-alpha.2 / index.js View on Github external
var output = JSON.stringify(copyTree(tree, opts));

      if (typeof opts.tasksJson === 'boolean' && opts.tasksJson) {
        return console.log(output);
      }
      return fs.writeFileSync(opts.tasksJson, output, 'utf-8');
    }
    try {
      log.info('Using gulpfile', color.highlight(tildify(env.configPath)));
      gulpInst.parallel(toRun)(function(err) {
        if (err) {
          exit(1);
        }
      });
    } catch (err) {
      log.error(color.error(err.message));
      log.error('To list available tasks, try running: gulp --tasks');
      exit(1);
    }
  });
}
github ginetta / skeleton / gulp / tasks / release.js View on Github external
inquirer.prompt([bumpTypeQuestion], function( answers ) {
    if (answers !== null && answers[bumpTypeQuestion.name] !== null) {
      bumpVersion(answers[bumpTypeQuestion.name], done);
    } else {
      logger.error('ERR: There was an error with the provided bump type');
      process.exit(1);
    }
  });
}
github gulpjs / gulp-cli / lib / versioned / ^3.7.0 / log / events.js View on Github external
gulpInst.on('task_not_found', function(err) {
    log.error(
      color.error('Task \'' + err.task + '\' is not in your gulpfile')
    );
    log.error('Please check the documentation for proper gulpfile formatting');
    exit(1);
  });
}

gulplog

Logger for gulp and gulp plugins

MIT
Latest version published 9 months ago

Package Health Score

74 / 100
Full package analysis