mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
Refactor stream log output to a utility.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
var syrup = require('syrup')
|
||||
var split = require('split')
|
||||
|
||||
var logger = require('../../../util/logger')
|
||||
var devutil = require('../../../util/devutil')
|
||||
var lifecycle = require('../../../util/lifecycle')
|
||||
var streamutil = require('../../../util/streamutil')
|
||||
|
||||
module.exports = syrup.serial()
|
||||
.dependency(require('../support/adb'))
|
||||
@@ -24,11 +24,8 @@ module.exports = syrup.serial()
|
||||
, '--listen-stats', service.port
|
||||
])
|
||||
.then(function(out) {
|
||||
lifecycle.share('Stats remote shell', out)
|
||||
out.pipe(split())
|
||||
.on('data', function(chunk) {
|
||||
log.info('Remote says: "%s"', chunk)
|
||||
})
|
||||
lifecycle.share('Stats shell', out)
|
||||
streamutil.talk(log, 'Stats shell says: "%s"', out)
|
||||
})
|
||||
})
|
||||
.then(function() {
|
||||
|
||||
Reference in New Issue
Block a user