Subramanya Sastry has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/183155

Change subject: Add tracing for the sanitizer
......................................................................

Add tracing for the sanitizer

Change-Id: I922dcd64743196d0777eceb9772e8ea5d6755818
---
M lib/ParsoidLogger.js
M lib/ext.core.Sanitizer.js
M lib/mediawiki.Util.js
3 files changed, 6 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/55/183155/1

diff --git a/lib/ParsoidLogger.js b/lib/ParsoidLogger.js
index 75dafac..e835e58 100644
--- a/lib/ParsoidLogger.js
+++ b/lib/ParsoidLogger.js
@@ -126,6 +126,7 @@
        "trace/p-wrap":     "[P]",
        "trace/html":       "[HTML]",
        "debug/html":       "[HTML-DBG]",
+       "trace/sanitizer":  "[SANITY]",
        "trace/tsp":        "[TSP]",
        "trace/dsr":        "[DSR]",
        "trace/list":       "[LIST]",
diff --git a/lib/ext.core.Sanitizer.js b/lib/ext.core.Sanitizer.js
index 6ceda60..5bf9f82 100644
--- a/lib/ext.core.Sanitizer.js
+++ b/lib/ext.core.Sanitizer.js
@@ -687,8 +687,11 @@
  * attribute in the DOM).
  */
 Sanitizer.prototype.onAny = function ( token ) {
+       var env = this.manager.env;
+       env.log("trace/sanitizer", this.manager.pipelineId, function() { return 
JSON.stringify(token); });
        // Pass through a transparent line meta-token
        if (Util.isEmptyLineMetaToken(token)) {
+               env.log("trace/sanitizer", this.manager.pipelineId, 
"--unchanged--");
                return { token: token };
        }
 
@@ -782,6 +785,7 @@
                }
        }
 
+       env.log("trace/sanitizer", this.manager.pipelineId, function() { return 
" ---> " + JSON.stringify(token); });
        return { token: token };
 };
 
diff --git a/lib/mediawiki.Util.js b/lib/mediawiki.Util.js
index 9c6914c..3993e77 100644
--- a/lib/mediawiki.Util.js
+++ b/lib/mediawiki.Util.js
@@ -118,6 +118,7 @@
                        "  * sync:3    : shows tokens flowing through the 
post-expansion Sync Token Transform Manager",
                        "  * tsp       : shows tokens flowing through the 
TokenStreamPatcher (useful to see in-order token stream)",
                        "  * list      : shows actions of the list handler",
+                       "  * sanitizer : shows actions of the sanitizer",
                        "  * pre       : shows actions of the pre handler",
                        "  * p-wrap    : shows actions of the paragraph 
wrapper",
                        "  * html      : shows tokens that are sent to the HTML 
tree builder",

-- 
To view, visit https://gerrit.wikimedia.org/r/183155
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I922dcd64743196d0777eceb9772e8ea5d6755818
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to