<commit_before>var es    = require('event-stream')
  , clone = require('clone')
  , sass  = require('node-sass')
  , path  = require('path')
  , gutil = require('gulp-util')
  , ext   = gutil.replaceExtension
  ;

module.exports = function (options) {
  var opts = options ? clone(options) : {};

  function nodeSass (file, cb) {
    if (path.basename(file.path).indexOf('_') === 0) {
      return cb();
    }

    if (file.isNull()) {
      return cb();
    }

    opts.data = file.contents.toString();

    opts.success = function (css) {
      file.path      = ext(file.path, '.css');
      file.shortened = file.shortened && ext(file.shortened, '.css');
      file.contents  = new Buffer(css);
      cb(null, file);
    }

    opts.error = function (err) {
      if (opts.errLogToConsole) {
        console.log(err);
        return cb();
      }
      return cb(new gutil.PluginError('gulp-sass', err));
    }

    sass.render(opts);
  }

  return es.map(nodeSass);
}<commit_msg>use gutil.log() for console logging errors<commit_after>var es    = require('event-stream')
  , clone = require('clone')
  , sass  = require('node-sass')
  , path  = require('path')
  , gutil = require('gulp-util')
  , ext   = gutil.replaceExtension
  ;

module.exports = function (options) {
  var opts = options ? clone(options) : {};

  function nodeSass (file, cb) {
    if (path.basename(file.path).indexOf('_') === 0) {
      return cb();
    }

    if (file.isNull()) {
      return cb();
    }

    opts.data = file.contents.toString();

    opts.success = function (css) {
      file.path      = ext(file.path, '.css');
      file.shortened = file.shortened && ext(file.shortened, '.css');
      file.contents  = new Buffer(css);
      cb(null, file);
    }

    opts.error = function (err) {
      if (opts.errLogToConsole) {
        gutil.log('[gulp-sass] ' + err)
        return cb();
      }
      return cb(new gutil.PluginError('gulp-sass', err));
    }

    sass.render(opts);
  }

  return es.map(nodeSass);
}
{'fraction_non_alphanumeric': 0.1712294673967148, 'fraction_numerical': 0.0009955201592832255, 'mean_word_length': 2.4956521739130433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6210698', 'n_tokens_mistral': 700, 'n_tokens_neox': 682, 'n_words': 136}