From ffbd428b8785ff4df0c477cda95d3bb581fa692a Mon Sep 17 00:00:00 2001 From: ansuz Date: Thu, 21 Apr 2016 15:06:03 +0200 Subject: [PATCH] better logging of browser fights --- www/p/main.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/www/p/main.js b/www/p/main.js index 307bc979d..b2306aff2 100644 --- a/www/p/main.js +++ b/www/p/main.js @@ -255,12 +255,18 @@ define([ var op = TextPatcher.diff(shjson, shjson2); // log the changes TextPatcher.log(shjson, op); + var sop = JSON.stringify(TextPatcher.format(shjson, op)); - var sop = JSON.stringify(op); - - if (module.fights.indexOf(sop) === -1) { + var index = module.fights.indexOf(sop); + if (index === -1) { module.fights.push(sop); console.log("Found a new type of browser disagreement"); + console.log("You can inspect the list in your " + + "console at `REALTIME_MODULE.fights`"); + console.log(module.fights); + } else { + console.log("Encountered a known browser disagreement: " + + "available at `REALTIME_MODULE.fights[%s]`", index); } } }