Legoktm has uploaded a new change for review.

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

Change subject: linter: Send logs to `env.log()` instead of `console.log()`
......................................................................

linter: Send logs to `env.log()` instead of `console.log()`

Change-Id: Ib3d6d445292d114240261b3a352acf63efc6d7cd
---
M lib/logger/linter.js
1 file changed, 8 insertions(+), 7 deletions(-)


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

diff --git a/lib/logger/linter.js b/lib/logger/linter.js
index 81ecf51..a6976cf 100644
--- a/lib/logger/linter.js
+++ b/lib/logger/linter.js
@@ -15,25 +15,26 @@
 };
 
 Linter.prototype.logLintOutput = function(logData, cb) {
+       var env = this._env;
        try {
-               if (!this._env.conf.parsoid.linterAPI) {
-                       console.log(this.buffer);
+               if (!env.conf.parsoid.linterAPI) {
+                       env.log(this.buffer);
                } else {
                        // Only send the request if it is
                        // the latest revision
-                       if (this._env.page.meta.revision.revid === 
this._env.page.latest) {
+                       if (env.page.meta.revision.revid === env.page.latest) {
                                request.post(
-                                       this._env.conf.parsoid.linterAPI,
+                                       env.conf.parsoid.linterAPI,
                                        { form: {
                                                data: 
JSON.stringify(this.buffer),
-                                               page: this._env.page.name,
-                                               revision: 
this._env.page.meta.revision.revid,
+                                               page: env.page.name,
+                                               revision: 
env.page.meta.revision.revid,
                                                action: 'record-lint',
                                                format: 'json',
                                                formatversion: 2,
                                        }, },
                                        function(error, response, body) {
-                                               console.log(body);
+                                               env.log(body);
                                        }
                                );
                        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib3d6d445292d114240261b3a352acf63efc6d7cd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to