1.0.0 • Published 10 years ago

@smallmultiples/gulp-error-logger v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 years ago

Gulp Error Logger

Takes an error object and tries to find the best thing to log from it. Optionally, depending on settings at creation, can pop up a system notification.

Usage

var errorFactory = require('gulp-error-logger')
var errorHandler = errorFactory()

// etc

foo.on('error', errorHandler)
bar.on('error', errorHandler)

API

errorFactory(options)

Returns a handler function that takes an error parameter, logging and notifying as necessary.

options is an optional object with optional properties:

  • notifications: Boolean, default true, send notifications when logging or not.
  • notificationMessage: Function that takes an error object and returns the message you want the notification to have.
  • notificationTitle: Function that takes an error object and returns the title you want the notification to have.
  • notifier: Function that takes an object with a title and a message, causes a notification to appear on the system. Defaults to node-notifier.
  • logger: Function that takes a string and logs it in some way. Defaults to gutil.log.