mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:18:48 +00:00
7d7e0c2428
- bug 890026 - Add mozcrash.kill_and_get_minidump r=jimm (11fe69e302) - Bug 1162115 - Bump mozdevice to 0.45, r=wlach (4b5891b54e) - Bug 1140145 - Update to latest wptrunner, a=testonly (a7860252bd) - Bug 1146321 - Update to latest wptrunner, a=testonly (c81ea8eddd) - Bug 115107 - Update to version of wptrunner that allows prefs to be set, r=Ms2ger, ahal (972f8c55bd) - Bug 1154691 - Update wptrunner to remove old exception type, a=testonly (f96ce919b1) - Bug 1150821 - Update to latest wptrunner, a=testonly (bea754f26c) - Bug 1153521 - Update to latest wptrunner, a=testonly (830e395995) - Bug 1155079 -Update to latest wptrunner, a=testonly (27cfd9c8a5) - Bug 1163709 - Update to latest wptrunner, a=testonly (76672ace86) - Bug 1160085 - Update to latest wptrunner, a=testonly (168e165a26) - Bug 1157218 - Update to latest wptrunner, a=testonly (d9eabd0213) - Bug 1171755 - Update to latest wptrunner, a=testonly (4f5b411410) - Bug 1139407 - [mozversion] Remove non-text formatters from command line log options. r=dhunt (32f7596553) - Bug 1160087 - [moznetwork] Add command line interface. r=wlach (2efccde362) - Bug 1175101 - [moznetwork] Bump version number to 0.25. r=wlachance (c8a0fa9ff2) - Bug 1176677 - [moznetwork] ImportError: "cannot import name structured", and release version 0.26. r=davehunt (009449ec79) - Bug 1160090 - [moznetwork] Add structured logging. r=wlach (05a7bc26bc) - Bug 1160094 - [moznetwork] Attempt to pick most suitable IP when multiple are associated with the hostname. r=wlach (db464651e1) - Bug 1163992 - [moznetwork] When multiple IPs are found on Windows pick the first one. r=wlachance (88207df55a) - Bug 1146292 - [mozlog] Bump version to 2.11. r=jgraham (3f9e252ac4) - Bug 1171032 - Log raw messages at debug level by default, r=chmanchester (1ac8fa11ff) - Bg 1171849 Let consumers override mozlog default formatter options, r=chmanchester (beb37921ca) - Bug 1066643 - [mozlog] Allow users of mozlog's command line options to exclude inappropriate log types. r=jgraham (8f4758a6c0) - Bug 1132409 - [mozlog] Create directories for log specified on the command line if not present. r=jgraham (2bda47bd25) - Bug 1177630 - Add formatter to mozlog for producing a machine readable error summary, r=chmanchester (a5930babb0) - Bug 1173380 - [mozprofile] cloned profiles are not cleaned (__del__ method is not called); r=ahal (9d7d931dbf) - Bug 1173682 - [mozbase] tests do not remove created directories; r=ahal (a4b3c112ab) - Bug 1161198 - Update mozdevice test for getLogcat; r=bc (10be1b1a85) - Bug 1014760 - Move mozlog.structured to mozlog; Move mozlog to mozlog.unstructured, r=jgraham (8c1eba0f64) - Bug 1176408 - Bump marionette-transport to 0.5 and marionette-driver to 0.9, r=dburns (fae313803a) - Bug 1178778 - Bump marionette-driver to 0.10. r=automatedtester DONTBUILD (4196568a38) - Bug 1183157 - make marionette --version flag also show the transport and driver package versions. r=dburns (e068536c58) - Bug 1189027: Bump marionette driver to 0.11; r=ato (b1d103c9ef) - Bug 1188826: Bump marionette client version for release; r=ato (018809aae3) - Bug 1176882 - Don't pin marionette-transport. r=davehunt (c660f3ab7b) - Bug 1169381 - Bump dependency for mozinfo in marionette-client to >=0.8. r=jgriffin (a6c0edc9bf) - Bug 1190817 - marionette install from pypi is broken. r=automatedtester (c43fbcfaee) - Bug 1163801 - Upgrade marionette-client from optparse to argparse, r=ahal (5843864209) - Bug 1163801 - Refactor marionette's options mixin system for argparse compatibility, r=AutomatedTester (c8153ebde4) - Bug 1197835 - Version bump marionette-client == 0.19, marionette-transport == 0.7, marionette-driver == 0.13, r=ato (4d7a79ae9a) - Bug 1200973 - Remove unneeded app cache code from Marionette; r=jgriffin (0c2792e2a5)
170 lines
4.2 KiB
JavaScript
170 lines
4.2 KiB
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
"use strict";
|
|
|
|
this.EXPORTED_SYMBOLS = [
|
|
"StructuredLogger"
|
|
];
|
|
|
|
/**
|
|
* TestLogger: Logger class generating messages compliant with the
|
|
* structured logging protocol for tests exposed by mozlog
|
|
*
|
|
* @param name
|
|
* The name of the logger to instantiate.
|
|
* @param dumpFun
|
|
* An underlying function to be used to log raw messages. This function
|
|
* will receive the complete serialized json string to log.
|
|
* @param mutators
|
|
* An array of functions used to add global context to log messages.
|
|
* These will each be called with the complete object to log as an
|
|
* argument.
|
|
*/
|
|
this.StructuredLogger = function (name, dumpFun=dump, mutators=[]) {
|
|
this.name = name;
|
|
this._dumpFun = dumpFun;
|
|
this._mutatorFuns = mutators;
|
|
this._runningTests = new Set();
|
|
}
|
|
|
|
/**
|
|
* Log functions producing messages in the format specified by mozlog
|
|
*/
|
|
StructuredLogger.prototype.testStart = function (test) {
|
|
this._runningTests.add(test);
|
|
let data = {test: test};
|
|
this._logData("test_start", data);
|
|
}
|
|
|
|
StructuredLogger.prototype.testStatus = function (test, subtest, status, expected="PASS",
|
|
message=null, stack=null, extra=null) {
|
|
let data = {
|
|
test: test,
|
|
subtest: subtest,
|
|
status: status,
|
|
};
|
|
|
|
if (expected != status && status != "SKIP") {
|
|
data.expected = expected;
|
|
}
|
|
if (message !== null) {
|
|
data.message = message;
|
|
}
|
|
if (stack !== null) {
|
|
data.stack = stack;
|
|
}
|
|
if (extra !== null) {
|
|
data.extra = extra;
|
|
}
|
|
|
|
this._logData("test_status", data);
|
|
}
|
|
|
|
StructuredLogger.prototype.testEnd = function (test, status, expected="OK", message=null,
|
|
stack=null, extra=null) {
|
|
let data = {test: test, status: status};
|
|
|
|
if (expected != status && status != "SKIP") {
|
|
data.expected = expected;
|
|
}
|
|
if (message !== null) {
|
|
data.message = message;
|
|
}
|
|
if (stack !== null) {
|
|
data.stack = stack;
|
|
}
|
|
if (extra !== null) {
|
|
data.extra = extra;
|
|
}
|
|
|
|
if (!this._runningTests.has(test)) {
|
|
this.error("Test \"" + test + "\" was ended more than once or never started. " +
|
|
"Ended with this data: " + JSON.stringify(data));
|
|
return;
|
|
}
|
|
|
|
this._runningTests.delete(test);
|
|
this._logData("test_end", data);
|
|
}
|
|
|
|
StructuredLogger.prototype.suiteStart = function (tests, runinfo=null) {
|
|
|
|
let data = {tests: tests};
|
|
if (runinfo !== null) {
|
|
data.runinfo = runinfo;
|
|
}
|
|
|
|
this._logData("suite_start", data);
|
|
};
|
|
|
|
StructuredLogger.prototype.suiteEnd = function () {
|
|
this._logData("suite_end");
|
|
};
|
|
|
|
/**
|
|
* Unstructured logging functions. The "extra" parameter can always by used to
|
|
* log suite specific data. If a "stack" field is provided it is logged at the
|
|
* top level of the data object for the benefit of mozlog's formatters.
|
|
*/
|
|
StructuredLogger.prototype.log = function (level, message, extra=null) {
|
|
let data = {
|
|
level: level,
|
|
message: message,
|
|
};
|
|
|
|
if (extra !== null) {
|
|
data.extra = extra;
|
|
if ("stack" in extra) {
|
|
data.stack = extra.stack;
|
|
}
|
|
}
|
|
|
|
this._logData("log", data);
|
|
}
|
|
|
|
StructuredLogger.prototype.debug = function (message, extra=null) {
|
|
this.log("DEBUG", message, extra);
|
|
}
|
|
|
|
StructuredLogger.prototype.info = function (message, extra=null) {
|
|
this.log("INFO", message, extra);
|
|
}
|
|
|
|
StructuredLogger.prototype.warning = function (message, extra=null) {
|
|
this.log("WARNING", message, extra);
|
|
}
|
|
|
|
StructuredLogger.prototype.error = function (message, extra=null) {
|
|
this.log("ERROR", message, extra);
|
|
}
|
|
|
|
StructuredLogger.prototype.critical = function (message, extra=null) {
|
|
this.log("CRITICAL", message, extra);
|
|
}
|
|
|
|
StructuredLogger.prototype._logData = function (action, data={}) {
|
|
let allData = {
|
|
action: action,
|
|
time: Date.now(),
|
|
thread: null,
|
|
pid: null,
|
|
source: this.name
|
|
};
|
|
|
|
for (let field in data) {
|
|
allData[field] = data[field];
|
|
}
|
|
|
|
for (let fun of this._mutatorFuns) {
|
|
fun(allData);
|
|
}
|
|
|
|
this._dumpMessage(allData);
|
|
};
|
|
|
|
StructuredLogger.prototype._dumpMessage = function (message) {
|
|
this._dumpFun(JSON.stringify(message));
|
|
}
|