Security update to Drupal 8.4.6
[yaffs-website] / node_modules / fancy-log / index.js
1 'use strict';
2 /*
3   Initial code from https://github.com/gulpjs/gulp-util/blob/v3.0.6/lib/log.js
4  */
5 var chalk = require('chalk');
6 var timestamp = require('time-stamp');
7
8 function getTimestamp(){
9   return '['+chalk.grey(timestamp('HH:mm:ss'))+']';
10 }
11
12 function log(){
13   var time = getTimestamp();
14   process.stdout.write(time + ' ');
15   console.log.apply(console, arguments);
16   return this;
17 }
18
19 function info(){
20   var time = getTimestamp();
21   process.stdout.write(time + ' ');
22   console.info.apply(console, arguments);
23   return this;
24 }
25
26 function dir(){
27   var time = getTimestamp();
28   process.stdout.write(time + ' ');
29   console.dir.apply(console, arguments);
30   return this;
31 }
32
33 function warn(){
34   var time = getTimestamp();
35   process.stderr.write(time + ' ');
36   console.warn.apply(console, arguments);
37   return this;
38 }
39
40 function error(){
41   var time = getTimestamp();
42   process.stderr.write(time + ' ');
43   console.error.apply(console, arguments);
44   return this;
45 }
46
47 module.exports = log;
48 module.exports.info = info;
49 module.exports.dir = dir;
50 module.exports.warn = warn;
51 module.exports.error = error;