Skip to content
This repository was archived by the owner on Sep 1, 2022. It is now read-only.

Commit 65c210a

Browse files
committed
add branching logic to support new gulplog stuff
1 parent 4656163 commit 65c210a

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

lib/log.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
var chalk = require('chalk');
2-
var dateformat = require('dateformat');
1+
var hasGulplog = require('has-gulplog');
32

43
module.exports = function(){
5-
var time = '['+chalk.grey(dateformat(new Date(), 'HH:MM:ss'))+']';
6-
process.stdout.write(time + ' ');
7-
console.log.apply(console, arguments);
4+
if(hasGulplog()){
5+
// specifically deferring loading here to keep from registering it globally
6+
var gulplog = require('gulplog');
7+
gulplog.info.apply(gulplog, arguments);
8+
} else {
9+
// specifically defering loading because it might not be used
10+
var fancylog = require('fancy-log');
11+
fancylog.apply(null, arguments);
12+
}
813
return this;
914
};

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
"beeper": "^1.0.0",
1515
"chalk": "^1.0.0",
1616
"dateformat": "^1.0.11",
17+
"fancy-log": "^1.0.0",
18+
"gulplog": "0.0.0",
19+
"has-gulplog": "^0.1.0",
1720
"lodash._reescape": "^3.0.0",
1821
"lodash._reevaluate": "^3.0.0",
1922
"lodash._reinterpolate": "^3.0.0",

0 commit comments

Comments
 (0)