mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 22:53:26 +02:00
Save device logs to rethinkdb.
This commit is contained in:
@@ -35,12 +35,25 @@ module.exports = function(options) {
|
||||
// Show serial number in logs
|
||||
logger.setGlobalIdentifier(options.serial)
|
||||
|
||||
// Output
|
||||
var push = zmq.socket('push')
|
||||
options.endpoints.push.forEach(function(endpoint) {
|
||||
log.info('Sending output to %s', endpoint)
|
||||
push.connect(endpoint)
|
||||
})
|
||||
|
||||
// Panic if necessary
|
||||
Promise.onPossiblyUnhandledRejection(function(err, promise) {
|
||||
log.fatal('Unhandled rejection', err.stack)
|
||||
selfDestruct()
|
||||
})
|
||||
|
||||
// Forward all logs
|
||||
logger.on('entry', function(entry) {
|
||||
push.send([wireutil.global,
|
||||
wireutil.makeDeviceLogMessage(options.serial, entry)])
|
||||
})
|
||||
|
||||
// Adb
|
||||
var adb = Promise.promisifyAll(adbkit.createClient())
|
||||
|
||||
@@ -299,13 +312,6 @@ module.exports = function(options) {
|
||||
}
|
||||
})
|
||||
|
||||
// Output
|
||||
var push = zmq.socket('push')
|
||||
options.endpoints.push.forEach(function(endpoint) {
|
||||
log.info('Sending output to %s', endpoint)
|
||||
push.connect(endpoint)
|
||||
})
|
||||
|
||||
function poke() {
|
||||
push.send([wireutil.global,
|
||||
wireutil.makeDevicePokeMessage(options.serial, solo)])
|
||||
|
||||
Reference in New Issue
Block a user