@smallmultiples/gulp-error-logger
v1.0.0
Published
Logs to console with gulp-util and notifies the user if they've asked for notifications.
Readme
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, defaulttrue, 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 togutil.log.
