ux: Show a supervisor starting log message in dashboard

Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
Cameron Diver 2019-03-28 16:06:26 +00:00
parent 0504776169
commit 196f173e13
No known key found for this signature in database
GPG Key ID: 49690ED87032539F

View File

@ -60,12 +60,16 @@ module.exports = class Supervisor extends EventEmitter
.then =>
@config.getMany(startupConfigFields)
.then (conf) =>
# We can't print to the dashboard until the logger has started up,
# so we leave a trail of breadcrumbs in the logs in case runtime
# fails to get to the first dashboard logs
console.log('Starting event tracker')
@eventTracker.init(conf)
.then =>
@eventTracker.track('Supervisor start')
.then =>
console.log('Starting up api binder')
@apiBinder.initClient()
.then =>
console.log('Starting logging infrastructure')
@logger.init({
apiEndpoint: conf.apiEndpoint,
uuid: conf.uuid,
@ -74,6 +78,8 @@ module.exports = class Supervisor extends EventEmitter
enableLogs: conf.loggingEnabled,
localMode: conf.localMode
})
.then =>
@logger.logSystemMessage('Supervisor starting', {}, 'Supervisor start')
.then =>
if conf.legacyAppsPresent
console.log('Legacy app detected, running migration')