Skip to content

Commit

Permalink
Add some original nodemon colour
Browse files Browse the repository at this point in the history
The 'log' event provides the original colour information stored in log.colour property, this can be used instead of log.message.
  • Loading branch information
Dvbnhbq authored Nov 21, 2016
1 parent 979bb1e commit de73518
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = function (options) {

// Forward log messages and stdin
script.on('log', function (log){
nodemonLog(log.message)
nodemonLog(log.colour)
})

// Shim 'on' for use with gulp tasks
Expand Down Expand Up @@ -94,5 +94,5 @@ module.exports = function (options) {
}

function nodemonLog(message){
console.log('[' + new Date().toString().split(' ')[4].gray + '] ' + ('[nodemon] ' + message).yellow)
console.log('[' + new Date().toString().split(' ')[4].gray + '] ' + message)
}

0 comments on commit de73518

Please sign in to comment.