gulp-log2

0.1.3 • Public • Published

gulp-log2

Pipe-inlined logging for gulp

NPM version Build Status Dependency Status

Install

$ npm install --save-dev gulp-log2

Usage

var gulp = require('gulp');
var log = require('gulp-log2');
 
gulp.task('default', function () {
    return gulp.src('foo.js')
        .pipe(log('starting the pipeline!'))
        .pipe(gulp.dest('dist'));
});

API

log(message, options)

message

Type: string

Log message to display.

options

title

Type: string
Default: 'gulp-log'

Use a custom title to make it easier to distinguish where messages are logged from.

level

Type: string
Default: 'info'

The output level for the log message. Each level has an associated color provided by Chalk:

  • 'fatal': bgRed
  • 'error': red
  • 'warn': yellow
  • 'info': green
  • 'debug': blue

log.levels[]

Associative array of output levels and colors. Custom levels can be added here.

Colors are provided by Chalk, and should be set like so:

var chalk = require('chalk');

log.levels['custom'] = chalk.magenta.underline;

Package Sidebar

Install

npm i gulp-log2

Weekly Downloads

6

Version

0.1.3

License

MIT

Last publish

Collaborators

  • coldacid