From 3e1dd1f92237482b90bd9a74bf0fdd98deeb3695 Mon Sep 17 00:00:00 2001 From: Petros Angelatos Date: Thu, 19 Jun 2014 14:49:30 +0100 Subject: [PATCH] Log every mixpanel event and remove redundant logs --- src/api.coffee | 1 - src/app.coffee | 1 - src/application.coffee | 2 -- src/supervisor-update.coffee | 3 --- src/utils.coffee | 1 + 5 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/api.coffee b/src/api.coffee index c68fc300..cc80672f 100644 --- a/src/api.coffee +++ b/src/api.coffee @@ -24,7 +24,6 @@ api.post '/v1/blink', (req, res) -> api.post '/v1/update', (req, res) -> utils.mixpanelTrack('Update notification') - console.log("Got application update") application.update() res.send(204) diff --git a/src/app.coffee b/src/app.coffee index 3e7e9f0b..890a938a 100644 --- a/src/app.coffee +++ b/src/app.coffee @@ -6,7 +6,6 @@ utils = require './utils' {spawn} = require 'child_process' bootstrap = require './bootstrap' -console.log('Supervisor started..') utils.mixpanelTrack('Supervisor start') knex('config').select('value').where(key: 'uuid').then ([uuid]) -> diff --git a/src/application.coffee b/src/application.coffee index 88bd0ea3..38e03fbb 100644 --- a/src/application.coffee +++ b/src/application.coffee @@ -58,7 +58,6 @@ exports.kill = kill = (app) -> exports.start = start = (app) -> docker.getImage(app.imageId).inspectAsync() .catch (error) -> - console.log("Pulling image:", app.imageId) utils.mixpanelTrack('Application install', app) docker.createImageAsync(fromImage: app.imageId) .then (stream) -> @@ -115,7 +114,6 @@ exports.start = start = (app) -> ) .tap -> utils.mixpanelTrack('Application start', app.imageId) - console.log('Started container:', app.imageId) exports.restart = restart = (app) -> kill(app) diff --git a/src/supervisor-update.coffee b/src/supervisor-update.coffee index 56571762..096ece9b 100644 --- a/src/supervisor-update.coffee +++ b/src/supervisor-update.coffee @@ -49,10 +49,8 @@ exports.update = -> .spread (localImageInfo, currentSupervisorImage) -> if localImageInfo.id == currentSupervisorImage utils.mixpanelTrack('Supervisor up to date') - console.log('Supervisor is up to date') return utils.mixpanelTrack('Supervisor update start', image: localImageInfo.id) - console.log('Creating updated supervisor container:', localImage) docker.createContainerAsync( Image: localImage Cmd: ['/start'] @@ -79,5 +77,4 @@ exports.update = -> process.exit() .catch (err) -> utils.mixpanelTrack('Supervisor update failed', error: err) - console.error('Error updating supervisor:', err) throw err diff --git a/src/utils.coffee b/src/utils.coffee index 2c7c4649..74ed3a7a 100644 --- a/src/utils.coffee +++ b/src/utils.coffee @@ -17,6 +17,7 @@ exports.mixpanelProperties = mixpanelProperties = username: require('/boot/config.json').username exports.mixpanelTrack = (event, properties={}) -> + console.log('Event:', event, JSON.stringify(properties)) # Mutation is bad, and it should feel bad properties = _.assign(_.cloneDeep(properties), mixpanelProperties)