1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-04 10:19:30 +02:00

Replace colors with chalk.

This commit is contained in:
Simo Kinnunen 2014-05-29 05:27:00 +09:00
parent fccf40d718
commit d1746ce745

View file

@ -1,8 +1,7 @@
var util = require('util')
var events = require('events')
// Enable "string".color
require('colors')
var chalk = require('chalk')
var Logger = new events.EventEmitter()
@ -45,7 +44,7 @@ function Log(tag) {
, 5: 'ERR'
, 6: 'FTL'
}
this.colors = {
this.styles = {
1: 'grey'
, 2: 'cyan'
, 3: 'green'
@ -118,7 +117,7 @@ Log.prototype._format = function(entry) {
}
Log.prototype._name = function(priority) {
return this.names[priority][this.colors[priority]]
return chalk[this.styles[priority]](this.names[priority])
}
Log.prototype._write = function(entry) {