-
-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New: Introduce gulplog & wire up listeners
- Loading branch information
Showing
14 changed files
with
182 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# EditorConfig is Awesome: http://editorconfig.org | ||
|
||
# Top-most EditorConfig file. | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file. | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
trim_trailing_whitespace = true | ||
|
||
# Don't trim whitespace in Markdown in order to be able | ||
# to do two spaces for line breaks. | ||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
'use strict'; | ||
|
||
var fancyLog = require('fancy-log'); | ||
|
||
// The sorting of the levels is | ||
// significant. | ||
var levels = [ | ||
'error', // -l: Logs error events. | ||
'warn', // -ll: Logs warn and error events. | ||
'info', // -lll: Logs info, warn and error events. | ||
'debug', // -llll: Logs all log levels. | ||
]; | ||
|
||
function toConsole(log, opts) { | ||
// Return immediately if logging is | ||
// not desired. | ||
if (opts.tasksSimple || opts.silent) { | ||
return; | ||
} | ||
|
||
// For some reason yargs sets | ||
// the default count for opts.loglevel to 2 | ||
// instead of 0 when we configure count: true | ||
// in the cliOptions. | ||
var loglevel = (opts.loglevel > 2) ? opts.loglevel - 2 : 3; | ||
|
||
levels | ||
.filter(function(item, i) { | ||
return i < loglevel; | ||
}) | ||
.forEach(function(level) { | ||
if (level === 'error') { | ||
log.on(level, fancyLog.error); | ||
} else { | ||
log.on(level, fancyLog); | ||
} | ||
}); | ||
} | ||
|
||
module.exports = toConsole; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.