mirror of
https://github.com/openstf/stf
synced 2025-10-04 18:29:17 +02:00
Rename log.prefix to log.globalPrefix.
This commit is contained in:
parent
f67eb6dd25
commit
4ff4f12443
2 changed files with 9 additions and 4 deletions
|
@ -39,21 +39,22 @@ Log.prototype.fatal = function() {
|
||||||
|
|
||||||
Log.prototype._format = function(priority, args) {
|
Log.prototype._format = function(priority, args) {
|
||||||
return util.format('%s %s/%s %d %s\n',
|
return util.format('%s %s/%s %d %s\n',
|
||||||
Log.prefix, priority, this.tag, process.pid, util.format.apply(util, args))
|
Log.globalPrefix, priority, this.tag, process.pid,
|
||||||
|
util.format.apply(util, args))
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.prototype._write = function(out) {
|
Log.prototype._write = function(out) {
|
||||||
this.stream.write(out)
|
this.stream.write(out)
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.prefix = '*'
|
Log.globalPrefix = '*'
|
||||||
|
|
||||||
Log.createLogger = function(tag) {
|
Log.createLogger = function(tag) {
|
||||||
return new Log(tag)
|
return new Log(tag)
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.setPrefix = function(prefix) {
|
Log.setGlobalPrefix = function(prefix) {
|
||||||
Log.prefix = prefix
|
Log.globalPrefix = prefix
|
||||||
}
|
}
|
||||||
|
|
||||||
exports = module.exports = Log
|
exports = module.exports = Log
|
||||||
|
|
|
@ -9,4 +9,8 @@ describe('Logger', function() {
|
||||||
expect(logger).itself.to.respondTo('createLogger')
|
expect(logger).itself.to.respondTo('createLogger')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should have a setGlobalPrefix method', function() {
|
||||||
|
expect(logger).itself.to.respondTo('setGlobalPrefix')
|
||||||
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue