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 => .then =>
@config.getMany(startupConfigFields) @config.getMany(startupConfigFields)
.then (conf) => .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) @eventTracker.init(conf)
.then => .then =>
@eventTracker.track('Supervisor start') console.log('Starting up api binder')
.then =>
@apiBinder.initClient() @apiBinder.initClient()
.then => .then =>
console.log('Starting logging infrastructure')
@logger.init({ @logger.init({
apiEndpoint: conf.apiEndpoint, apiEndpoint: conf.apiEndpoint,
uuid: conf.uuid, uuid: conf.uuid,
@ -74,6 +78,8 @@ module.exports = class Supervisor extends EventEmitter
enableLogs: conf.loggingEnabled, enableLogs: conf.loggingEnabled,
localMode: conf.localMode localMode: conf.localMode
}) })
.then =>
@logger.logSystemMessage('Supervisor starting', {}, 'Supervisor start')
.then => .then =>
if conf.legacyAppsPresent if conf.legacyAppsPresent
console.log('Legacy app detected, running migration') console.log('Legacy app detected, running migration')