Log errors from Gulp
@param {string} task
508414
function handleError (task) {
  return function (err) {
    console.log(chalk.red(err));
    notify.onError(task + ' failed, check the logs..')(err);
  };
}
613979
function invokeConfigFn(tasks) {
		for (var taskName in tasks) {
			if (tasks.hasOwnProperty(taskName)) {
				tasks[taskName](gulp, plugins, growl, path);
			}
		}
	}
262246
static void logE(Task action, String msg, Throwable error) {
        Log.e(TAG, toLogStr(action, msg), error);
    }
661317
function (task) {
  return function (err) {
    notify.onError({
      message: task + ' failed, check the logs',
      sound: false
    })(err);
    gutil.log(gutil.colors.bgRed(task + ' error:'), gutil.colors.red(err));
  };
}
606525
function fsOperationFailed(stream, sourceFile, err) {
	if (err.code !== 'ENOENT') {
		stream.emit('error', new PluginError('gulp-changed', err, {
			fileName: sourceFile.path
		}));
	}

	stream.push(sourceFile);
}
638403
function error (out, desc) {
  logger.error(header())
  if (desc) {
    logger.error(desc)
  }
  logger.error(out)
  logger.error()
}
894711
function reportRunningTask(taskname) {
    const icon = require('./ci-icon');
    function done(success) {
        success
            ? console.log(`${icon.success()} ${taskname}`)
            : console.log(`${icon.error()} ${taskname}`);
    }

    return done;
}
388128
function moduleWatchTask(taskname, fn) {
    var module = this;
    var fulltaskname = module.name + '-' + taskname + '-watch';

    module.task(taskname + '-watch', null, function(cb) {

      var w = fn();

      if(!w) {
        throw new Error('No options returned from watch: ' + taskname);
      }

      if(!w.glob) {
        throw new Error('No glob watch property in options: ' + taskname);
      }

      w.tasks = w.tasks || [taskname];

      var i = w.tasks.length;

      while(i--) {
        w.tasks[i] = module.name + '-' + w.tasks[i];
      }

      var watcher =  gulp.watch(w.glob, w.tasks);

      function onEvent(event) {
        console.log(event);
      }

      watcher.on('change', function(event) {
        console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
        var exec = require('child_process').exec;

        exec('growlnotify --image gulp-tasks/run.png -n angular-project-template -m "' + module.name + '-' + taskname + ': build triggered."')
      });

      cb();
    }, true);

    module.watchTasks.push(fulltaskname);
  }
217519
function logError(terminal: Terminal, format: string, ...args: Array<mixed>): void {
  const str = util.format(format, ...args);
  terminal.log('%s: %s', chalk.red('error'), str);
}
773335
function catchErrors() {
  // don't use an arrow function, we need the `this` instance!
  return plumber(function(err) {
    if (!err.plugin) {
      err.plugin = 'gulp-task-maker'
    }
    showError(err)
    // keep watch tasks running
    if (this && typeof this.emit === 'function') {
      this.emit('end')
    }
  })
}
448541
function() {
    // A stack, latest task is the last item in the array
    this.tasks = [];
    this.currentLine = 0;

    // Keeping track of current line in the log
    // Shadow stdout.write and stderr.write
    newlines(process.stdout);
    newlines(process.stderr);
    process.stderr.on('newline', function() {
        this.currentLine++;
    }.bind(this));
    process.stdout.on('newline', function() {
        this.currentLine++;
    }.bind(this));

    // Functions to expose
    this.log = function() {
        // Similar to console.log, but nested appropriately
        const args = [].slice.call(arguments);
        log(console.log, args, this.tasks.length);
    };

    this.error = function() {
        // Similar to console.error, but nested appropriately
        const args = [].slice.call(arguments);
        log(console.error, args, this.tasks.length);
    };

    /**
     *  Task tracking, acts almost like a wrapper around Promise(func(resolve, reject))
     *  If the passed in function takes no arguments, then it is assumed to be a sync
     *  call that may throw (reject) or return a value (resolve)
     *
     *  @returns Promise that resolves/rejects as if the contents, but adds some
     *  logging logic around it
     */
    this.task = function(taskName, taskFunction) {
        const indentation = this.tasks.length;
        const lines = indentation === 0 ? 1 : 0;

        // Push a simple task object to the queue
        const task = {
            name: taskName,
            line: this.currentLine + lines,
            indentation: indentation
        };

        const introLine = `${_.repeat('\t', indentation)}${taskName}`;

        const finish = function(t, succeed, err) {
            const idx = _.findIndex(this.tasks, t);
            if (idx === -1) {
                throw new Error('Task is not part of the logger');
            }

            // Remove from tasks
            this.tasks.splice(idx, 1);

            // Create message to write, then decide where to write
            let message;
            if (succeed) {
                message = `${introLine} ${chalk.green('✔')}`;
            } else if (err) {
                message = `${introLine} ${chalk.red('✖')} ${err.message}`;
            } else {
                message = `${introLine} ${chalk.red('✖')}`;
            }

            // Simple check, if on next line of the task, append to previous line
            // otherwise add a new line
            if (this.currentLine === task.line + 1) {
                cursor.up(1).eraseLine().write(message).down(1).horizontalAbsolute(0);
            } else {
                cursor.write(message).write('\n\n');
            }
        }.bind(this);

        return new Promise(function(resolve, reject) {
            // If there are currently no tasks, add an empty line
            // (top-level or first tasks are separated by empty lines)
            if (this.tasks.length === 0) {
                cursor.write('\n');
            }

            // Print out the task name
            cursor.write(`${introLine}\n`);

            // Add to the tasks array
            this.tasks.push(task);

            if (taskFunction.length === 0) {
                // Sync task
                try {
                    const result = taskFunction();
                    finish(task, true, null);
                    resolve(result);
                } catch (err) {
                    finish(task, false, err);
                    reject(err);
                }
            } else {
                // Async task
                const res = function(value) {
                    finish(task, true, null);
                    resolve(value);
                };

                const rej = function(err) {
                    finish(task, false, err);
                    reject(err);
                };

                taskFunction(res, rej);
            }
        }.bind(this));
    };

    return this;
}
74591
def error(self, msg, *args, **kwargs) -> Task:  # type: ignore
        
        return self._make_log_task(logging.ERROR, msg, args, **kwargs)
265994
function concatJS() {
    let tasks = [];

    Object.keys(config).forEach((key) => {
        let val = config[key];
        tasks.push(gulp.src(val.src)
            .pipe(plumber({ errorHandler: handleErrors }))
            .pipe(concat(key + '.js'))
            .pipe(gulp.dest(val.dest)));
    });

    return merge(tasks);
}
923560
function onError( error ) {
        logger.error( error.stack || error );
        process.exit( EXIT_FAILURE );
    }
539271
function(callback) {
            var stream = this;

            // We don't need to write an empty file.
            if (collectedErrors.length === 0) {
                callback();

                return;
            }

            var report = collectedErrors.join('\n\n').trim() + '\n';

            // Write the error output to the defined file
            fs.writeFile(options.path, report, function(err) {
                if (err) {
                    stream.emit('error', new gutil.PluginError('gulp-phpcs', err));
                    callback();

                    return;
                }

                // Build console info message
                var message = util.format(
                    'Your PHPCS report with %s got written to %s',
                    chalk.red(pluralize('error', collectedErrors.length, true)),
                    chalk.magenta(options.path)
                );

                // And output it.
                gutil.log(message);

                callback();
            });
        }
1340039
function gulp(opts) {
  opts = opts || {};

  var failOnError = opts['failOnError'] || false;
  var interimFiles = [];
  var failedValidations = [];

  return Through(
    function (file) {
      interimFiles.push(file.path);
      this.queue(file);
    },
    function () {
      var baseFile = opts.packageFile;

      interimFiles.forEach(function (file) {
        opts.packageFile = file;

        var results = validate(opts);

        if (hasErrors(results)) {
          failedValidations.push(file);
          log(results);
        }
      });

      opts.packageFile = baseFile;

      if (failOnError &&  failedValidations.length) {
        this.emit('error', new PluginError('dep-validate', 'Unable to validate dependencies'));
      } else {
        this.emit('end');
      }
    }
  );
}
960338
function(gulp, tasks, workflows, patternConfig) {

        gulp.task('list', function() {

            var printTasks = true,
                printWorkflows = true;

            if (args.t) {
                printWorkflows = false;
            } else if (args.w) {
                printTasks = false;
            }

            if (printTasks) {

                console.log('');
                console.log('');
                console.log(chalk.blue.bold('list of tasks:'));
                console.log(chalk.blue.bold('--------------\n'));

                var allTasks = Object.keys(tasks).sort();

                if (patternConfig && patternConfig.tasks && patternConfig.tasks.ignore.length > 0) {
                    allTasks = allTasks.filter(function(task) {
                        return patternConfig.tasks.ignore.indexOf(task) === -1;
                    });
                }

                _.each(allTasks, function(name) {
                    console.log(chalk.yellow.bold(name));
                    if (tasks[name].help) {
                        console.log('  ' + chalk.gray(tasks[name].help.message));
                    }
                });
            }

            if (printWorkflows) {

                console.log('');
                console.log('');
                console.log(chalk.blue.bold('list of workflows:'));
                console.log(chalk.blue.bold('------------------\n'));

                var workflowNames = _.xor(Object.keys(workflows), Object.keys(tasks));
                _.each(workflowNames.sort(), function(name) {
                    console.log(chalk.yellow.bold(name));
                    console.log(chalk.gray(workflows[name].help.message));

                    if (workflows[name].dep.length > 0) {
                        var end,
                            deps = ' ';

                        _.each(workflows[name].dep, function(dep, i) {
                            end = (workflows[name].dep.length === (i + 1)) ? '.' : ', ';
                            deps = deps + dep + end;
                        });

                        console.log(chalk.white.bold('- tasks run:') + chalk.gray(deps));
                    }

                    console.log('\n');
                });
            }

            console.log('');
            console.log('');
            return gulp;
        });
    }