Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Reporter? #6

Open
nfarrar opened this issue Nov 1, 2014 · 1 comment
Open

Custom Reporter? #6

nfarrar opened this issue Nov 1, 2014 · 1 comment

Comments

@nfarrar
Copy link

nfarrar commented Nov 1, 2014

Any possibility of adding a hook for a custom reporter? I'd like to pass the message off to a function that formats the message so it matches the rest of my logs.

Something like this would be awesome:

var fileLogMessage = function(title, file) {

  var color = $.util.colors.blue;
  var label = title; // vendor
  var message = file.path + ':( ' + file.count + ')'; // app/styles/main.scss (1)

  $.util.log(color(label + message)); // [08:37:23] vendor file: /app/styles/main.scss (1)
};

gulp.task('vendor', function() {
  return gulp.src(mainBowerFiles())
  .pipe($.plumber(config.plumber))

  // disableDefaultMessages: Hide the (Found [X] files.) messages.
  // title: When running several build tasks in parallel, there is no indication of which task the file was found in. This would allow users to inject the name of the task into the filelog call.
  // customReporter: The function that should be called to override the reporting behavior.
  .pipe($.filelog({disableDefaultMessages: true, title: 'vendor file', customReporter: fileLogMessage}))
});
@adamayres
Copy link
Owner

I like this idea, what are your thoughts on adding the customer reporter as a config param vs. using a model similar to gulp-jshint for reporters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants