mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +02:00
Replace colors with chalk.
This commit is contained in:
parent
fccf40d718
commit
d1746ce745
1 changed files with 3 additions and 4 deletions
|
@ -1,8 +1,7 @@
|
||||||
var util = require('util')
|
var util = require('util')
|
||||||
var events = require('events')
|
var events = require('events')
|
||||||
|
|
||||||
// Enable "string".color
|
var chalk = require('chalk')
|
||||||
require('colors')
|
|
||||||
|
|
||||||
var Logger = new events.EventEmitter()
|
var Logger = new events.EventEmitter()
|
||||||
|
|
||||||
|
@ -45,7 +44,7 @@ function Log(tag) {
|
||||||
, 5: 'ERR'
|
, 5: 'ERR'
|
||||||
, 6: 'FTL'
|
, 6: 'FTL'
|
||||||
}
|
}
|
||||||
this.colors = {
|
this.styles = {
|
||||||
1: 'grey'
|
1: 'grey'
|
||||||
, 2: 'cyan'
|
, 2: 'cyan'
|
||||||
, 3: 'green'
|
, 3: 'green'
|
||||||
|
@ -118,7 +117,7 @@ Log.prototype._format = function(entry) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.prototype._name = function(priority) {
|
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) {
|
Log.prototype._write = function(entry) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue