mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 08:13:31 +02:00
Refactor stream log output to a utility.
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
var syrup = require('syrup')
|
||||
|
||||
var logger = require('../util/logger')
|
||||
var lifecycle = require('../util/lifecycle')
|
||||
|
||||
module.exports = function(options) {
|
||||
// Show serial number in logs
|
||||
logger.setGlobalIdentifier(options.serial)
|
||||
|
||||
var log = logger.createLogger('device')
|
||||
|
||||
return syrup.serial()
|
||||
// We want to send logs before anything else start happening
|
||||
.dependency(require('./device/plugins/logsender'))
|
||||
@@ -35,4 +38,8 @@ module.exports = function(options) {
|
||||
.consume(options)
|
||||
})
|
||||
.consume(options)
|
||||
.catch(function(err) {
|
||||
log.fatal('Setup had an error', err.stack)
|
||||
lifecycle.fatal()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user