diff options
author | Daniel Beauchamp <daniel.beauchamp@shopify.com> | 2012-09-17 11:16:31 -0400 |
---|---|---|
committer | Daniel Beauchamp <daniel.beauchamp@shopify.com> | 2012-09-17 11:16:31 -0400 |
commit | a3d84c8c0a30f5b761c37f6f2c805346d0009acd (patch) | |
tree | 1a423ba15ab0dbdad324076f9b4f7160b434798d /javascripts | |
parent | 4bf82f6303465bb74e9e6d2747d3053358ef83b7 (diff) |
Added a debug mode that lets you see all messages coming in.
Diffstat (limited to 'javascripts')
-rw-r--r-- | javascripts/dashing.coffee | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/javascripts/dashing.coffee b/javascripts/dashing.coffee index 964cf2c..528ae2c 100644 --- a/javascripts/dashing.coffee +++ b/javascripts/dashing.coffee @@ -81,6 +81,7 @@ Dashing.AnimatedValue = Dashing.widgets = widgets = {} Dashing.lastEvents = lastEvents = {} +Dashing.debugMode = false source = new EventSource('/events') source.addEventListener 'open', (e) -> @@ -93,6 +94,8 @@ source.addEventListener 'error', (e)-> source.addEventListener 'message', (e) => data = JSON.parse(e.data) + if Dashing.debugMode + console.log("Received data for #{data.id}", data) lastEvents[data.id] = data if widgets[data.id]?.length > 0 for widget in widgets[data.id] |