mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 451283 - Move log4moz.js to Toolkit as Log.jsm. r=gps,Mossop
--HG-- rename : services/common/log4moz.js => toolkit/modules/Log.jsm rename : services/common/tests/unit/test_log4moz.js => toolkit/modules/tests/xpcshell/test_Log.js
This commit is contained in:
parent
11da72d482
commit
b26d6917b1
@ -19,9 +19,9 @@ let gDataNotificationInfoBar = {
|
||||
},
|
||||
|
||||
get _log() {
|
||||
let log4moz = Cu.import("resource://services-common/log4moz.js", {}).Log4Moz;
|
||||
let Log = Cu.import("resource://gre/modules/Log.jsm", {}).Log;
|
||||
delete this._log;
|
||||
return this._log = log4moz.repository.getLogger("Services.DataReporting.InfoBar");
|
||||
return this._log = Log.repository.getLogger("Services.DataReporting.InfoBar");
|
||||
},
|
||||
|
||||
init: function() {
|
||||
|
@ -58,10 +58,10 @@ function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let ns = {};
|
||||
Components.utils.import("resource://services-common/log4moz.js", ns);
|
||||
rootLogger = ns.Log4Moz.repository.rootLogger;
|
||||
dumpAppender = new ns.Log4Moz.DumpAppender();
|
||||
dumpAppender.level = ns.Log4Moz.Level.All;
|
||||
Components.utils.import("resource://gre/modules/Log.jsm", ns);
|
||||
rootLogger = ns.Log.repository.rootLogger;
|
||||
dumpAppender = new ns.Log.DumpAppender();
|
||||
dumpAppender.level = ns.Log.Level.All;
|
||||
rootLogger.addAppender(dumpAppender);
|
||||
|
||||
let notification = document.getElementById("global-notificationbox");
|
||||
|
@ -3,7 +3,6 @@
|
||||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
modules := \
|
||||
log4moz.js \
|
||||
storageservice.js \
|
||||
stringbundle.js \
|
||||
tokenserverclient.js \
|
||||
|
@ -24,7 +24,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/rest.js");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
|
||||
@ -47,8 +47,8 @@ Object.freeze(BagheeraClientRequestResult.prototype);
|
||||
function BagheeraRequest(uri) {
|
||||
RESTRequest.call(this, uri);
|
||||
|
||||
this._log = Log4Moz.repository.getLogger("Services.BagheeraClient");
|
||||
this._log.level = Log4Moz.Level.Debug;
|
||||
this._log = Log.repository.getLogger("Services.BagheeraClient");
|
||||
this._log.level = Log.Level.Debug;
|
||||
}
|
||||
|
||||
BagheeraRequest.prototype = Object.freeze({
|
||||
@ -69,8 +69,8 @@ this.BagheeraClient = function BagheeraClient(baseURI) {
|
||||
throw new Error("baseURI argument must be defined.");
|
||||
}
|
||||
|
||||
this._log = Log4Moz.repository.getLogger("Services.BagheeraClient");
|
||||
this._log.level = Log4Moz.Level.Debug;
|
||||
this._log = Log.repository.getLogger("Services.BagheeraClient");
|
||||
this._log.level = Log.Level.Debug;
|
||||
|
||||
this.baseURI = baseURI;
|
||||
|
||||
|
@ -8,7 +8,7 @@ const {utils: Cu} = Components;
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["BagheeraServer"];
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
Cu.import("resource://testing-common/httpd.js");
|
||||
|
||||
@ -23,7 +23,7 @@ Cu.import("resource://testing-common/httpd.js");
|
||||
* The Bagheera server is essentially a glorified document store.
|
||||
*/
|
||||
this.BagheeraServer = function BagheeraServer() {
|
||||
this._log = Log4Moz.repository.getLogger("metrics.BagheeraServer");
|
||||
this._log = Log.repository.getLogger("metrics.BagheeraServer");
|
||||
|
||||
this.server = new HttpServer();
|
||||
this.namespaces = {};
|
||||
|
@ -11,7 +11,7 @@ this.EXPORTED_SYMBOLS = [
|
||||
|
||||
const {utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
|
||||
this.initTestLogging = function initTestLogging(level) {
|
||||
function LogStats() {
|
||||
@ -19,7 +19,7 @@ this.initTestLogging = function initTestLogging(level) {
|
||||
}
|
||||
LogStats.prototype = {
|
||||
format: function format(message) {
|
||||
if (message.level == Log4Moz.Level.Error) {
|
||||
if (message.level == Log.Level.Error) {
|
||||
this.errorsLogged += 1;
|
||||
}
|
||||
|
||||
@ -27,20 +27,20 @@ this.initTestLogging = function initTestLogging(level) {
|
||||
message.message + "\n";
|
||||
}
|
||||
};
|
||||
LogStats.prototype.__proto__ = new Log4Moz.Formatter();
|
||||
LogStats.prototype.__proto__ = new Log.Formatter();
|
||||
|
||||
let log = Log4Moz.repository.rootLogger;
|
||||
let log = Log.repository.rootLogger;
|
||||
let logStats = new LogStats();
|
||||
let appender = new Log4Moz.DumpAppender(logStats);
|
||||
let appender = new Log.DumpAppender(logStats);
|
||||
|
||||
if (typeof(level) == "undefined") {
|
||||
level = "Debug";
|
||||
}
|
||||
getTestLogger().level = Log4Moz.Level[level];
|
||||
Log4Moz.repository.getLogger("Services").level = Log4Moz.Level[level];
|
||||
getTestLogger().level = Log.Level[level];
|
||||
Log.repository.getLogger("Services").level = Log.Level[level];
|
||||
|
||||
log.level = Log4Moz.Level.Trace;
|
||||
appender.level = Log4Moz.Level.Trace;
|
||||
log.level = Log.Level.Trace;
|
||||
appender.level = Log.Level.Trace;
|
||||
// Overwrite any other appenders (e.g. from previous incarnations)
|
||||
log.ownAppenders = [appender];
|
||||
log.updateAppenders();
|
||||
@ -49,6 +49,6 @@ this.initTestLogging = function initTestLogging(level) {
|
||||
}
|
||||
|
||||
this.getTestLogger = function getTestLogger(component) {
|
||||
return Log4Moz.repository.getLogger("Testing");
|
||||
return Log.repository.getLogger("Testing");
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ this.EXPORTED_SYMBOLS = [
|
||||
|
||||
Cu.import("resource://testing-common/httpd.js");
|
||||
Cu.import("resource://services-common/async.js");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
|
||||
const STORAGE_HTTP_LOGGER = "Services.Common.Test.Server";
|
||||
@ -74,7 +74,7 @@ this.ServerBSO = function ServerBSO(id, payload, modified) {
|
||||
throw new Error("BSO ID is invalid: " + id);
|
||||
}
|
||||
|
||||
this._log = Log4Moz.repository.getLogger(STORAGE_HTTP_LOGGER);
|
||||
this._log = Log.repository.getLogger(STORAGE_HTTP_LOGGER);
|
||||
|
||||
this.id = id;
|
||||
if (!payload) {
|
||||
@ -287,7 +287,7 @@ this.StorageServerCollection =
|
||||
CommonUtils.ensureMillisecondsTimestamp(timestamp);
|
||||
this._timestamp = timestamp;
|
||||
|
||||
this._log = Log4Moz.repository.getLogger(STORAGE_HTTP_LOGGER);
|
||||
this._log = Log.repository.getLogger(STORAGE_HTTP_LOGGER);
|
||||
}
|
||||
StorageServerCollection.prototype = {
|
||||
BATCH_MAX_COUNT: 100, // # of records.
|
||||
@ -872,7 +872,7 @@ this.StorageServer = function StorageServer(callback) {
|
||||
this.started = false;
|
||||
this.users = {};
|
||||
this.requestCount = 0;
|
||||
this._log = Log4Moz.repository.getLogger(STORAGE_HTTP_LOGGER);
|
||||
this._log = Log.repository.getLogger(STORAGE_HTTP_LOGGER);
|
||||
|
||||
// Install our own default handler. This allows us to mess around with the
|
||||
// whole URL space.
|
||||
|
@ -17,7 +17,7 @@ this.EXPORTED_SYMBOLS = [
|
||||
Cu.import("resource://gre/modules/Preferences.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "CryptoUtils",
|
||||
@ -91,9 +91,9 @@ this.RESTRequest = function RESTRequest(uri) {
|
||||
this.uri = uri;
|
||||
|
||||
this._headers = {};
|
||||
this._log = Log4Moz.repository.getLogger(this._logName);
|
||||
this._log = Log.repository.getLogger(this._logName);
|
||||
this._log.level =
|
||||
Log4Moz.Level[Prefs.get("log.logger.rest.request")];
|
||||
Log.Level[Prefs.get("log.logger.rest.request")];
|
||||
}
|
||||
RESTRequest.prototype = {
|
||||
|
||||
@ -309,7 +309,7 @@ RESTRequest.prototype = {
|
||||
}
|
||||
|
||||
this._log.debug(method + " Length: " + data.length);
|
||||
if (this._log.level <= Log4Moz.Level.Trace) {
|
||||
if (this._log.level <= Log.Level.Trace) {
|
||||
this._log.trace(method + " Body: " + data);
|
||||
}
|
||||
|
||||
@ -444,7 +444,7 @@ RESTRequest.prototype = {
|
||||
this._log.debug(this.method + " " + uri + " " + this.response.status);
|
||||
|
||||
// Additionally give the full response body when Trace logging.
|
||||
if (this._log.level <= Log4Moz.Level.Trace) {
|
||||
if (this._log.level <= Log.Level.Trace) {
|
||||
this._log.trace(this.method + " body: " + this.response.body);
|
||||
}
|
||||
|
||||
@ -593,9 +593,9 @@ RESTRequest.prototype = {
|
||||
* the RESTRequest.
|
||||
*/
|
||||
this.RESTResponse = function RESTResponse() {
|
||||
this._log = Log4Moz.repository.getLogger(this._logName);
|
||||
this._log = Log.repository.getLogger(this._logName);
|
||||
this._log.level =
|
||||
Log4Moz.Level[Prefs.get("log.logger.rest.response")];
|
||||
Log.Level[Prefs.get("log.logger.rest.response")];
|
||||
}
|
||||
RESTResponse.prototype = {
|
||||
|
||||
|
@ -35,7 +35,7 @@ const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Preferences.jsm");
|
||||
Cu.import("resource://services-common/async.js");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/rest.js");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
|
||||
@ -470,8 +470,8 @@ this.StorageServiceRequestError = function StorageServiceRequestError() {
|
||||
* to implement it transparently.
|
||||
*/
|
||||
function StorageServiceRequest() {
|
||||
this._log = Log4Moz.repository.getLogger("Sync.StorageService.Request");
|
||||
this._log.level = Log4Moz.Level[Prefs.get("log.level")];
|
||||
this._log = Log.repository.getLogger("Sync.StorageService.Request");
|
||||
this._log.level = Log.Level[Prefs.get("log.level")];
|
||||
|
||||
this.notModified = false;
|
||||
|
||||
@ -1521,8 +1521,8 @@ Object.freeze(StorageCollectionBatchedDelete.prototype);
|
||||
* (string) Base URI for all requests.
|
||||
*/
|
||||
this.StorageServiceClient = function StorageServiceClient(baseURI) {
|
||||
this._log = Log4Moz.repository.getLogger("Services.Common.StorageServiceClient");
|
||||
this._log.level = Log4Moz.Level[Prefs.get("log.level")];
|
||||
this._log = Log.repository.getLogger("Services.Common.StorageServiceClient");
|
||||
this._log.level = Log.Level[Prefs.get("log.level")];
|
||||
|
||||
this._baseURI = baseURI;
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
* 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/. */
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
Cu.import("resource://testing-common/httpd.js");
|
||||
Cu.import("resource://testing-common/services-common/logging.js");
|
||||
|
||||
let btoa = Cu.import("resource://services-common/log4moz.js").btoa;
|
||||
let atob = Cu.import("resource://services-common/log4moz.js").atob;
|
||||
let btoa = Cu.import("resource://gre/modules/Log.jsm").btoa;
|
||||
let atob = Cu.import("resource://gre/modules/Log.jsm").atob;
|
||||
|
||||
function do_check_empty(obj) {
|
||||
do_check_attribute_count(obj, 0);
|
||||
|
@ -4,7 +4,6 @@
|
||||
const modules = [
|
||||
"async.js",
|
||||
"bagheeraclient.js",
|
||||
"log4moz.js",
|
||||
"rest.js",
|
||||
"storageservice.js",
|
||||
"stringbundle.js",
|
||||
|
@ -2,15 +2,15 @@
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/rest.js");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
|
||||
//DEBUG = true;
|
||||
|
||||
function run_test() {
|
||||
Log4Moz.repository.getLogger("Services.Common.RESTRequest").level =
|
||||
Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Services.Common.RESTRequest").level =
|
||||
Log.Level.Trace;
|
||||
initTestLogging("Trace");
|
||||
|
||||
run_next_test();
|
||||
|
@ -105,8 +105,8 @@ function doDeleteRequest(request) {
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
Log4Moz.repository.getLogger("Services.Common.Test.StorageServer").level =
|
||||
Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Services.Common.Test.StorageServer").level =
|
||||
Log.Level.Trace;
|
||||
initTestLogging();
|
||||
|
||||
run_next_test();
|
||||
|
@ -25,7 +25,6 @@ firefox-appdir = browser
|
||||
[test_async_querySpinningly.js]
|
||||
[test_bagheera_server.js]
|
||||
[test_bagheera_client.js]
|
||||
[test_log4moz.js]
|
||||
[test_observers.js]
|
||||
[test_restrequest.js]
|
||||
[test_tokenauthenticatedrequest.js]
|
||||
|
@ -14,7 +14,7 @@ this.EXPORTED_SYMBOLS = [
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Preferences.jsm");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/rest.js");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
|
||||
@ -114,8 +114,8 @@ TokenServerClientServerError.prototype.constructor =
|
||||
* at fault (e.g. differentiating a 503 from a 401).
|
||||
*/
|
||||
this.TokenServerClient = function TokenServerClient() {
|
||||
this._log = Log4Moz.repository.getLogger("Common.TokenServerClient");
|
||||
this._log.level = Log4Moz.Level[Prefs.get("logger.level")];
|
||||
this._log = Log.repository.getLogger("Common.TokenServerClient");
|
||||
this._log.level = Log.Level[Prefs.get("logger.level")];
|
||||
}
|
||||
TokenServerClient.prototype = {
|
||||
/**
|
||||
|
@ -10,7 +10,7 @@ Cu.import("resource://gre/modules/Promise.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/osfile.jsm")
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
|
||||
this.CommonUtils = {
|
||||
exceptionStr: function exceptionStr(e) {
|
||||
@ -88,7 +88,7 @@ this.CommonUtils = {
|
||||
try {
|
||||
return Services.io.newURI(URIString, null, null);
|
||||
} catch (e) {
|
||||
let log = Log4Moz.repository.getLogger("Common.Utils");
|
||||
let log = Log.repository.getLogger("Common.Utils");
|
||||
log.debug("Could not create URI: " + CommonUtils.exceptionStr(e));
|
||||
return null;
|
||||
}
|
||||
@ -464,7 +464,7 @@ this.CommonUtils = {
|
||||
* @param def
|
||||
* (Number) The default value to use if the preference is not defined.
|
||||
* @param log
|
||||
* (Log4Moz.Logger) Logger to write warnings to.
|
||||
* (Log.Logger) Logger to write warnings to.
|
||||
*/
|
||||
getEpochPref: function getEpochPref(branch, pref, def=0, log=null) {
|
||||
if (!Number.isInteger(def)) {
|
||||
@ -507,7 +507,7 @@ this.CommonUtils = {
|
||||
* (Number) The default value (in milliseconds) if the preference is
|
||||
* not defined or invalid.
|
||||
* @param log
|
||||
* (Log4Moz.Logger) Logger to write warnings to.
|
||||
* (Log.Logger) Logger to write warnings to.
|
||||
* @param oldestYear
|
||||
* (Number) Oldest year to accept in read values.
|
||||
*/
|
||||
|
@ -223,7 +223,7 @@ DataReportingService.prototype = Object.freeze({
|
||||
|
||||
Cu.import("resource://gre/modules/Task.jsm", ns);
|
||||
Cu.import("resource://gre/modules/HealthReport.jsm", ns);
|
||||
Cu.import("resource://services-common/log4moz.js", ns);
|
||||
Cu.import("resource://gre/modules/Log.jsm", ns);
|
||||
|
||||
// How many times will we rewrite this code before rolling it up into a
|
||||
// generic module? See also bug 451283.
|
||||
@ -238,22 +238,22 @@ DataReportingService.prototype = Object.freeze({
|
||||
let loggingPrefs = new Preferences(HEALTHREPORT_LOGGING_BRANCH);
|
||||
if (loggingPrefs.get("consoleEnabled", true)) {
|
||||
let level = loggingPrefs.get("consoleLevel", "Warn");
|
||||
let appender = new ns.Log4Moz.ConsoleAppender();
|
||||
appender.level = ns.Log4Moz.Level[level] || ns.Log4Moz.Level.Warn;
|
||||
let appender = new ns.Log.ConsoleAppender();
|
||||
appender.level = ns.Log.Level[level] || ns.Log.Level.Warn;
|
||||
|
||||
for (let name of LOGGERS) {
|
||||
let logger = ns.Log4Moz.repository.getLogger(name);
|
||||
let logger = ns.Log.repository.getLogger(name);
|
||||
logger.addAppender(appender);
|
||||
}
|
||||
}
|
||||
|
||||
if (loggingPrefs.get("dumpEnabled", false)) {
|
||||
let level = loggingPrefs.get("dumpLevel", "Debug");
|
||||
let appender = new ns.Log4Moz.DumpAppender();
|
||||
appender.level = ns.Log4Moz.Level[level] || ns.Log4Moz.Level.Debug;
|
||||
let appender = new ns.Log.DumpAppender();
|
||||
appender.level = ns.Log.Level[level] || ns.Log.Level.Debug;
|
||||
|
||||
for (let name of LOGGERS) {
|
||||
let logger = ns.Log4Moz.repository.getLogger(name);
|
||||
let logger = ns.Log.repository.getLogger(name);
|
||||
logger.addAppender(appender);
|
||||
}
|
||||
}
|
||||
|
@ -8,12 +8,12 @@ this.EXPORTED_SYMBOLS = ["MockPolicyListener"];
|
||||
|
||||
const {utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
|
||||
|
||||
this.MockPolicyListener = function MockPolicyListener() {
|
||||
this._log = Log4Moz.repository.getLogger("Services.DataReporting.Testing.MockPolicyListener");
|
||||
this._log.level = Log4Moz.Level["Debug"];
|
||||
this._log = Log.repository.getLogger("Services.DataReporting.Testing.MockPolicyListener");
|
||||
this._log.level = Log.Level["Debug"];
|
||||
|
||||
this.requestDataUploadCount = 0;
|
||||
this.lastDataRequest = null;
|
||||
|
@ -27,7 +27,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||
#endif
|
||||
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
|
||||
const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
|
||||
@ -263,8 +263,8 @@ this.DataSubmissionRequest.prototype = Object.freeze({
|
||||
* events.
|
||||
*/
|
||||
this.DataReportingPolicy = function (prefs, healthReportPrefs, listener) {
|
||||
this._log = Log4Moz.repository.getLogger("Services.DataReporting.Policy");
|
||||
this._log.level = Log4Moz.Level["Debug"];
|
||||
this._log = Log.repository.getLogger("Services.DataReporting.Policy");
|
||||
this._log.level = Log.Level["Debug"];
|
||||
|
||||
for (let handler of this.REQUIRED_LISTENERS) {
|
||||
if (!listener[handler]) {
|
||||
|
@ -16,7 +16,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Preferences.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
|
||||
|
||||
@ -69,7 +69,7 @@ this.SessionRecorder = function (branch) {
|
||||
throw new Error("branch argument must end with '.': " + branch);
|
||||
}
|
||||
|
||||
this._log = Log4Moz.repository.getLogger("Services.DataReporting.SessionRecorder");
|
||||
this._log = Log.repository.getLogger("Services.DataReporting.SessionRecorder");
|
||||
|
||||
this._prefs = new Preferences(branch);
|
||||
this._lastActivityWasInactive = false;
|
||||
|
@ -18,7 +18,7 @@ Cu.import("resource://services-common/async.js");
|
||||
Cu.import("resource://services-common/bagheeraclient.js");
|
||||
#endif
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
Cu.import("resource://gre/modules/osfile.jsm");
|
||||
@ -260,7 +260,7 @@ function AbstractHealthReporter(branch, policy, sessionRecorder) {
|
||||
throw new Error("Must provide policy to HealthReporter constructor.");
|
||||
}
|
||||
|
||||
this._log = Log4Moz.repository.getLogger("Services.HealthReport.HealthReporter");
|
||||
this._log = Log.repository.getLogger("Services.HealthReport.HealthReporter");
|
||||
this._log.info("Initializing health reporter instance against " + branch);
|
||||
|
||||
this._branch = branch;
|
||||
|
@ -25,7 +25,7 @@ const REQUIRED_UINT32_TYPE = {type: "TYPE_UINT32"};
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
Cu.import("resource://gre/modules/osfile.jsm")
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
|
||||
// Profile creation time access.
|
||||
|
@ -20,7 +20,7 @@ const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
Cu.import("resource://gre/modules/Preferences.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
|
||||
|
||||
@ -86,7 +86,7 @@ this.Measurement = function () {
|
||||
}
|
||||
}
|
||||
|
||||
this._log = Log4Moz.repository.getLogger("Services.Metrics.Measurement." + this.name);
|
||||
this._log = Log.repository.getLogger("Services.Metrics.Measurement." + this.name);
|
||||
|
||||
this.id = null;
|
||||
this.storage = null;
|
||||
@ -502,7 +502,7 @@ this.Provider = function () {
|
||||
throw new Error("Provider must define measurement types.");
|
||||
}
|
||||
|
||||
this._log = Log4Moz.repository.getLogger("Services.Metrics.Provider." + this.name);
|
||||
this._log = Log.repository.getLogger("Services.Metrics.Provider." + this.name);
|
||||
|
||||
this.measurements = null;
|
||||
this.storage = null;
|
||||
|
@ -14,7 +14,7 @@ Cu.import("resource://gre/modules/services/metrics/dataprovider.jsm");
|
||||
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@ Cu.import("resource://services-common/utils.js");
|
||||
* provides APIs for bulk collection of data.
|
||||
*/
|
||||
this.ProviderManager = function (storage) {
|
||||
this._log = Log4Moz.repository.getLogger("Services.Metrics.ProviderManager");
|
||||
this._log = Log.repository.getLogger("Services.Metrics.ProviderManager");
|
||||
|
||||
this._providers = new Map();
|
||||
this._storage = storage;
|
||||
|
@ -22,7 +22,7 @@ const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
|
||||
Cu.import("resource://gre/modules/Promise.jsm");
|
||||
Cu.import("resource://gre/modules/Sqlite.jsm");
|
||||
Cu.import("resource://gre/modules/Task.jsm");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
|
||||
|
||||
@ -698,7 +698,7 @@ this.MetricsStorageBackend = function (path) {
|
||||
* FUTURE enforce 1 read/write connection per database limit.
|
||||
*/
|
||||
function MetricsStorageSqliteBackend(connection) {
|
||||
this._log = Log4Moz.repository.getLogger("Services.Metrics.MetricsStorage");
|
||||
this._log = Log.repository.getLogger("Services.Metrics.MetricsStorage");
|
||||
|
||||
this._connection = connection;
|
||||
this._enabledWALCheckpointPages = null;
|
||||
|
@ -16,7 +16,7 @@ const {utils: Cu} = Components;
|
||||
Cu.import("resource://services-sync/record.js");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
|
||||
let btoa = Cu.import("resource://services-common/log4moz.js").btoa;
|
||||
let btoa = Cu.import("resource://gre/modules/Log.jsm").btoa;
|
||||
|
||||
this.FakeFilesystemService = function FakeFilesystemService(contents) {
|
||||
this.fakeContents = contents;
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
Cu.import("resource://gre/modules/AddonManager.jsm");
|
||||
|
||||
@ -113,9 +113,9 @@ this.EXPORTED_SYMBOLS = ["AddonsReconciler", "CHANGE_INSTALLED",
|
||||
* heed them like they were normal. In the end, the state is proper.
|
||||
*/
|
||||
this.AddonsReconciler = function AddonsReconciler() {
|
||||
this._log = Log4Moz.repository.getLogger("Sync.AddonsReconciler");
|
||||
this._log = Log.repository.getLogger("Sync.AddonsReconciler");
|
||||
let level = Svc.Prefs.get("log.logger.addonsreconciler", "Debug");
|
||||
this._log.level = Log4Moz.Level[level];
|
||||
this._log.level = Log.Level[level];
|
||||
|
||||
Svc.Obs.add("xpcom-shutdown", this.stopListening, this);
|
||||
};
|
||||
@ -140,7 +140,7 @@ AddonsReconciler.prototype = {
|
||||
*/
|
||||
_shouldPersist: true,
|
||||
|
||||
/** log4moz logger instance */
|
||||
/** Log logger instance */
|
||||
_log: null,
|
||||
|
||||
/**
|
||||
|
@ -9,7 +9,7 @@ this.EXPORTED_SYMBOLS = ["AddonUtils"];
|
||||
const {interfaces: Ci, utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
|
||||
@ -18,8 +18,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
|
||||
"resource://gre/modules/AddonRepository.jsm");
|
||||
|
||||
function AddonUtilsInternal() {
|
||||
this._log = Log4Moz.repository.getLogger("Sync.AddonUtils");
|
||||
this._log.Level = Log4Moz.Level[Svc.Prefs.get("log.logger.addonutils")];
|
||||
this._log = Log.repository.getLogger("Sync.AddonUtils");
|
||||
this._log.Level = Log.Level[Svc.Prefs.get("log.logger.addonutils")];
|
||||
}
|
||||
AddonUtilsInternal.prototype = {
|
||||
/**
|
||||
|
@ -13,7 +13,7 @@ this.EXPORTED_SYMBOLS = [
|
||||
const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://services-common/async.js");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/observers.js");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
@ -42,9 +42,9 @@ this.Tracker = function Tracker(name, engine) {
|
||||
this.name = this.file = name.toLowerCase();
|
||||
this.engine = engine;
|
||||
|
||||
this._log = Log4Moz.repository.getLogger("Sync.Tracker." + name);
|
||||
this._log = Log.repository.getLogger("Sync.Tracker." + name);
|
||||
let level = Svc.Prefs.get("log.logger.engine." + this.name, "Debug");
|
||||
this._log.level = Log4Moz.Level[level];
|
||||
this._log.level = Log.Level[level];
|
||||
|
||||
this._score = 0;
|
||||
this._ignored = [];
|
||||
@ -197,9 +197,9 @@ this.Store = function Store(name, engine) {
|
||||
this.name = name.toLowerCase();
|
||||
this.engine = engine;
|
||||
|
||||
this._log = Log4Moz.repository.getLogger("Sync.Store." + name);
|
||||
this._log = Log.repository.getLogger("Sync.Store." + name);
|
||||
let level = Svc.Prefs.get("log.logger.engine." + this.name, "Debug");
|
||||
this._log.level = Log4Moz.Level[level];
|
||||
this._log.level = Log.Level[level];
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "_timer", function() {
|
||||
return Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
@ -383,8 +383,8 @@ this.EngineManager = function EngineManager(service) {
|
||||
this.service = service;
|
||||
|
||||
this._engines = {};
|
||||
this._log = Log4Moz.repository.getLogger("Sync.EngineManager");
|
||||
this._log.level = Log4Moz.Level[Svc.Prefs.get(
|
||||
this._log = Log.repository.getLogger("Sync.EngineManager");
|
||||
this._log.level = Log.Level[Svc.Prefs.get(
|
||||
"log.logger.service.engines", "Debug")];
|
||||
}
|
||||
EngineManager.prototype = {
|
||||
@ -476,9 +476,9 @@ this.Engine = function Engine(name, service) {
|
||||
this.service = service;
|
||||
|
||||
this._notify = Utils.notify("weave:engine:");
|
||||
this._log = Log4Moz.repository.getLogger("Sync.Engine." + this.Name);
|
||||
this._log = Log.repository.getLogger("Sync.Engine." + this.Name);
|
||||
let level = Svc.Prefs.get("log.logger.engine." + this.name, "Debug");
|
||||
this._log.level = Log4Moz.Level[level];
|
||||
this._log.level = Log.Level[level];
|
||||
|
||||
this._tracker; // initialize tracker to load previously changed IDs
|
||||
this._log.debug("Engine initialized");
|
||||
@ -1056,7 +1056,7 @@ SyncEngine.prototype = {
|
||||
* Truthy if incoming record should be applied. False if not.
|
||||
*/
|
||||
_reconcile: function _reconcile(item) {
|
||||
if (this._log.level <= Log4Moz.Level.Trace) {
|
||||
if (this._log.level <= Log.Level.Trace) {
|
||||
this._log.trace("Incoming: " + item);
|
||||
}
|
||||
|
||||
@ -1273,7 +1273,7 @@ SyncEngine.prototype = {
|
||||
for each (let id in modifiedIDs) {
|
||||
try {
|
||||
let out = this._createRecord(id);
|
||||
if (this._log.level <= Log4Moz.Level.Trace)
|
||||
if (this._log.level <= Log.Level.Trace)
|
||||
this._log.trace("Outgoing: " + out);
|
||||
|
||||
out.encrypt(this.service.collectionKeys.keyForCollection(this.name));
|
||||
|
@ -14,7 +14,7 @@ Cu.import("resource://services-sync/record.js");
|
||||
Cu.import("resource://services-common/async.js");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
|
||||
const FORMS_TTL = 5184000; // 60 days
|
||||
|
||||
@ -31,7 +31,7 @@ Utils.deferGetSet(FormRec, "cleartext", ["name", "value"]);
|
||||
|
||||
|
||||
let FormWrapper = {
|
||||
_log: Log4Moz.repository.getLogger("Sync.Engine.Forms"),
|
||||
_log: Log.repository.getLogger("Sync.Engine.Forms"),
|
||||
|
||||
_getEntryCols: ["fieldname", "value"],
|
||||
_guidCols: ["guid"],
|
||||
|
@ -13,7 +13,7 @@ const HISTORY_TTL = 5184000; // 60 days
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://services-common/async.js");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/engines.js");
|
||||
Cu.import("resource://services-sync/record.js");
|
||||
|
@ -10,7 +10,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
|
||||
// Lazy import to prevent unnecessary load on startup.
|
||||
@ -57,8 +57,8 @@ for (let symbol of ["BulkKeyBundle", "SyncKeyBundle"]) {
|
||||
* and any other function that involves the built-in functionality.
|
||||
*/
|
||||
this.IdentityManager = function IdentityManager() {
|
||||
this._log = Log4Moz.repository.getLogger("Sync.Identity");
|
||||
this._log.Level = Log4Moz.Level[Svc.Prefs.get("log.logger.identity")];
|
||||
this._log = Log.repository.getLogger("Sync.Identity");
|
||||
this._log.Level = Log.Level[Svc.Prefs.get("log.logger.identity")];
|
||||
|
||||
this._basicPassword = null;
|
||||
this._basicPasswordAllowLookup = true;
|
||||
|
@ -6,7 +6,7 @@ this.EXPORTED_SYMBOLS = ["JPAKEClient", "SendCredentialsController"];
|
||||
|
||||
const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/rest.js");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
@ -114,8 +114,8 @@ const JPAKE_VERIFY_VALUE = "0123456789ABCDEF";
|
||||
this.JPAKEClient = function JPAKEClient(controller) {
|
||||
this.controller = controller;
|
||||
|
||||
this._log = Log4Moz.repository.getLogger("Sync.JPAKEClient");
|
||||
this._log.level = Log4Moz.Level[Svc.Prefs.get(
|
||||
this._log = Log.repository.getLogger("Sync.JPAKEClient");
|
||||
this._log.level = Log.Level[Svc.Prefs.get(
|
||||
"log.logger.service.jpakeclient", "Debug")];
|
||||
|
||||
this._serverURL = Svc.Prefs.get("jpake.serverURL");
|
||||
@ -700,8 +700,8 @@ JPAKEClient.prototype = {
|
||||
*/
|
||||
this.SendCredentialsController =
|
||||
function SendCredentialsController(jpakeclient, service) {
|
||||
this._log = Log4Moz.repository.getLogger("Sync.SendCredentialsController");
|
||||
this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.service.main")];
|
||||
this._log = Log.repository.getLogger("Sync.SendCredentialsController");
|
||||
this._log.level = Log.Level[Svc.Prefs.get("log.logger.service.main")];
|
||||
|
||||
this._log.trace("Loading.");
|
||||
this.jpakeclient = jpakeclient;
|
||||
|
@ -12,7 +12,7 @@ this.EXPORTED_SYMBOLS = [
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
|
||||
/**
|
||||
@ -120,7 +120,7 @@ KeyBundle.prototype = {
|
||||
* This is just a KeyBundle with a collection attached.
|
||||
*/
|
||||
this.BulkKeyBundle = function BulkKeyBundle(collection) {
|
||||
let log = Log4Moz.repository.getLogger("Sync.BulkKeyBundle");
|
||||
let log = Log.repository.getLogger("Sync.BulkKeyBundle");
|
||||
log.info("BulkKeyBundle being created for " + collection);
|
||||
KeyBundle.call(this);
|
||||
|
||||
@ -177,7 +177,7 @@ BulkKeyBundle.prototype = {
|
||||
* If the username or Sync Key is invalid, an Error will be thrown.
|
||||
*/
|
||||
this.SyncKeyBundle = function SyncKeyBundle(username, syncKey) {
|
||||
let log = Log4Moz.repository.getLogger("Sync.SyncKeyBundle");
|
||||
let log = Log.repository.getLogger("Sync.SyncKeyBundle");
|
||||
log.info("SyncKeyBundle being created.");
|
||||
KeyBundle.call(this);
|
||||
|
||||
|
@ -10,7 +10,7 @@ const Cr = Components.results;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://services-common/observers.js");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
|
||||
this.Notifications = {
|
||||
@ -115,7 +115,7 @@ this.NotificationButton =
|
||||
try {
|
||||
callback.apply(this, arguments);
|
||||
} catch (e) {
|
||||
let logger = Log4Moz.repository.getLogger("Sync.Notifications");
|
||||
let logger = Log.repository.getLogger("Sync.Notifications");
|
||||
logger.error("An exception occurred: " + Utils.exceptionStr(e));
|
||||
logger.info(Utils.stackTrace(e));
|
||||
throw e;
|
||||
|
@ -9,7 +9,7 @@ this.EXPORTED_SYMBOLS = [
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/engines.js");
|
||||
Cu.import("resource://services-sync/status.js");
|
||||
@ -20,7 +20,7 @@ this.SyncScheduler = function SyncScheduler(service) {
|
||||
this.init();
|
||||
}
|
||||
SyncScheduler.prototype = {
|
||||
_log: Log4Moz.repository.getLogger("Sync.SyncScheduler"),
|
||||
_log: Log.repository.getLogger("Sync.SyncScheduler"),
|
||||
|
||||
_fatalLoginStatus: [LOGIN_FAILED_NO_USERNAME,
|
||||
LOGIN_FAILED_NO_PASSWORD,
|
||||
@ -67,7 +67,7 @@ SyncScheduler.prototype = {
|
||||
set numClients(value) Svc.Prefs.set("numClients", value),
|
||||
|
||||
init: function init() {
|
||||
this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.service.main")];
|
||||
this._log.level = Log.Level[Svc.Prefs.get("log.logger.service.main")];
|
||||
this.setDefaults();
|
||||
Svc.Obs.add("weave:engine:score:updated", this);
|
||||
Svc.Obs.add("network:offline-status-changed", this);
|
||||
@ -500,24 +500,24 @@ ErrorHandler.prototype = {
|
||||
},
|
||||
|
||||
initLogs: function initLogs() {
|
||||
this._log = Log4Moz.repository.getLogger("Sync.ErrorHandler");
|
||||
this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.service.main")];
|
||||
this._log = Log.repository.getLogger("Sync.ErrorHandler");
|
||||
this._log.level = Log.Level[Svc.Prefs.get("log.logger.service.main")];
|
||||
this._cleaningUpFileLogs = false;
|
||||
|
||||
let root = Log4Moz.repository.getLogger("Sync");
|
||||
root.level = Log4Moz.Level[Svc.Prefs.get("log.rootLogger")];
|
||||
let root = Log.repository.getLogger("Sync");
|
||||
root.level = Log.Level[Svc.Prefs.get("log.rootLogger")];
|
||||
|
||||
let formatter = new Log4Moz.BasicFormatter();
|
||||
let capp = new Log4Moz.ConsoleAppender(formatter);
|
||||
capp.level = Log4Moz.Level[Svc.Prefs.get("log.appender.console")];
|
||||
let formatter = new Log.BasicFormatter();
|
||||
let capp = new Log.ConsoleAppender(formatter);
|
||||
capp.level = Log.Level[Svc.Prefs.get("log.appender.console")];
|
||||
root.addAppender(capp);
|
||||
|
||||
let dapp = new Log4Moz.DumpAppender(formatter);
|
||||
dapp.level = Log4Moz.Level[Svc.Prefs.get("log.appender.dump")];
|
||||
let dapp = new Log.DumpAppender(formatter);
|
||||
dapp.level = Log.Level[Svc.Prefs.get("log.appender.dump")];
|
||||
root.addAppender(dapp);
|
||||
|
||||
let fapp = this._logAppender = new Log4Moz.StorageStreamAppender(formatter);
|
||||
fapp.level = Log4Moz.Level[Svc.Prefs.get("log.appender.file.level")];
|
||||
let fapp = this._logAppender = new Log.StorageStreamAppender(formatter);
|
||||
fapp.level = Log.Level[Svc.Prefs.get("log.appender.file.level")];
|
||||
root.addAppender(fapp);
|
||||
},
|
||||
|
||||
|
@ -18,7 +18,7 @@ const Cu = Components.utils;
|
||||
const CRYPTO_COLLECTION = "crypto";
|
||||
const KEYS_WBO = "keys";
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/keys.js");
|
||||
Cu.import("resource://services-sync/resource.js");
|
||||
@ -111,7 +111,7 @@ Utils.deferGetSet(WBORecord, "data", ["id", "modified", "sortindex", "payload"])
|
||||
this.RecordManager = function RecordManager(service) {
|
||||
this.service = service;
|
||||
|
||||
this._log = Log4Moz.repository.getLogger(this._logName);
|
||||
this._log = Log.repository.getLogger(this._logName);
|
||||
this._records = {};
|
||||
}
|
||||
RecordManager.prototype = {
|
||||
@ -281,7 +281,7 @@ this.CollectionKeyManager = function CollectionKeyManager() {
|
||||
this._collections = {};
|
||||
this._default = null;
|
||||
|
||||
this._log = Log4Moz.repository.getLogger("Sync.CollectionKeyManager");
|
||||
this._log = Log.repository.getLogger("Sync.CollectionKeyManager");
|
||||
}
|
||||
|
||||
// TODO: persist this locally as an Identity. Bug 610913.
|
||||
|
@ -14,7 +14,7 @@ const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/Preferences.jsm");
|
||||
Cu.import("resource://services-common/async.js");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/observers.js");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
@ -50,9 +50,9 @@ const DEFAULT_LOAD_FLAGS =
|
||||
* the status of the HTTP response.
|
||||
*/
|
||||
this.AsyncResource = function AsyncResource(uri) {
|
||||
this._log = Log4Moz.repository.getLogger(this._logName);
|
||||
this._log = Log.repository.getLogger(this._logName);
|
||||
this._log.level =
|
||||
Log4Moz.Level[Svc.Prefs.get("log.logger.network.resources")];
|
||||
Log.Level[Svc.Prefs.get("log.logger.network.resources")];
|
||||
this.uri = uri;
|
||||
this._headers = {};
|
||||
this._onComplete = Utils.bind2(this, this._onComplete);
|
||||
@ -265,7 +265,7 @@ AsyncResource.prototype = {
|
||||
this._log.debug(mesg);
|
||||
|
||||
// Additionally give the full response body when Trace logging.
|
||||
if (this._log.level <= Log4Moz.Level.Trace)
|
||||
if (this._log.level <= Log.Level.Trace)
|
||||
this._log.trace(action + " body: " + data);
|
||||
|
||||
} catch(ex) {
|
||||
@ -588,8 +588,8 @@ ChannelListener.prototype = {
|
||||
function ChannelNotificationListener(headersToCopy) {
|
||||
this._headersToCopy = headersToCopy;
|
||||
|
||||
this._log = Log4Moz.repository.getLogger(this._logName);
|
||||
this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.network.resources")];
|
||||
this._log = Log.repository.getLogger(this._logName);
|
||||
this._log.level = Log.Level[Svc.Prefs.get("log.logger.network.resources")];
|
||||
}
|
||||
ChannelNotificationListener.prototype = {
|
||||
_logName: "Sync.Resource",
|
||||
@ -609,7 +609,7 @@ ChannelNotificationListener.prototype = {
|
||||
},
|
||||
|
||||
notifyCertProblem: function certProblem(socketInfo, sslStatus, targetHost) {
|
||||
let log = Log4Moz.repository.getLogger("Sync.CertListener");
|
||||
let log = Log.repository.getLogger("Sync.CertListener");
|
||||
log.warn("Invalid HTTPS certificate encountered!");
|
||||
|
||||
// This suppresses the UI warning only. The request is still cancelled.
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/rest.js");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
|
@ -20,7 +20,7 @@ const KEYS_WBO = "keys";
|
||||
|
||||
Cu.import("resource://gre/modules/Preferences.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/engines.js");
|
||||
@ -317,9 +317,9 @@ Sync11Service.prototype = {
|
||||
|
||||
this.errorHandler = new ErrorHandler(this);
|
||||
|
||||
this._log = Log4Moz.repository.getLogger("Sync.Service");
|
||||
this._log = Log.repository.getLogger("Sync.Service");
|
||||
this._log.level =
|
||||
Log4Moz.Level[Svc.Prefs.get("log.logger.service.main")];
|
||||
Log.Level[Svc.Prefs.get("log.logger.service.main")];
|
||||
|
||||
this._log.info("Loading Weave " + WEAVE_VERSION);
|
||||
|
||||
|
@ -6,7 +6,7 @@ this.EXPORTED_SYMBOLS = ["ClusterManager"];
|
||||
|
||||
const {utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/policies.js");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
@ -15,8 +15,8 @@ Cu.import("resource://services-sync/util.js");
|
||||
* Contains code for managing the Sync cluster we are in.
|
||||
*/
|
||||
this.ClusterManager = function ClusterManager(service) {
|
||||
this._log = Log4Moz.repository.getLogger("Sync.Service");
|
||||
this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.service.main")];
|
||||
this._log = Log.repository.getLogger("Sync.Service");
|
||||
this._log.level = Log.Level[Svc.Prefs.get("log.logger.service.main")];
|
||||
|
||||
this.service = service;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ this.EXPORTED_SYMBOLS = ["EngineSynchronizer"];
|
||||
|
||||
const {utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/engines.js");
|
||||
Cu.import("resource://services-sync/policies.js");
|
||||
@ -22,8 +22,8 @@ Cu.import("resource://services-sync/util.js");
|
||||
* This was originally split out of service.js. The API needs lots of love.
|
||||
*/
|
||||
this.EngineSynchronizer = function EngineSynchronizer(service) {
|
||||
this._log = Log4Moz.repository.getLogger("Sync.Synchronizer");
|
||||
this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.synchronizer")];
|
||||
this._log = Log.repository.getLogger("Sync.Synchronizer");
|
||||
this._log.level = Log.Level[Svc.Prefs.get("log.logger.synchronizer")];
|
||||
|
||||
this.service = service;
|
||||
|
||||
|
@ -10,12 +10,12 @@ const Cr = Components.results;
|
||||
const Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/identity.js");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
this.Status = {
|
||||
_log: Log4Moz.repository.getLogger("Sync.Status"),
|
||||
_log: Log.repository.getLogger("Sync.Status"),
|
||||
_authManager: new IdentityManager(),
|
||||
ready: false,
|
||||
|
||||
@ -114,7 +114,7 @@ this.Status = {
|
||||
} catch (ex) {
|
||||
// Use default.
|
||||
}
|
||||
this._log.level = Log4Moz.Level[logLevel];
|
||||
this._log.level = Log.Level[logLevel];
|
||||
|
||||
this._log.info("Resetting Status.");
|
||||
this.service = STATUS_OK;
|
||||
|
@ -10,7 +10,7 @@ this.EXPORTED_SYMBOLS = [
|
||||
|
||||
const {utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/rest.js");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
Cu.import("resource://services-sync/identity.js");
|
||||
@ -24,8 +24,8 @@ Cu.import("resource://services-sync/util.js");
|
||||
* Instances are constructed with the base URI of the service.
|
||||
*/
|
||||
this.UserAPI10Client = function UserAPI10Client(baseURI) {
|
||||
this._log = Log4Moz.repository.getLogger("Sync.UserAPI");
|
||||
this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.userapi")];
|
||||
this._log = Log.repository.getLogger("Sync.UserAPI");
|
||||
this._log.level = Log.Level[Svc.Prefs.get("log.logger.userapi")];
|
||||
|
||||
this.baseURI = baseURI;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ this.EXPORTED_SYMBOLS = ["XPCOMUtils", "Services", "NetUtil", "PlacesUtils",
|
||||
|
||||
const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/observers.js");
|
||||
Cu.import("resource://services-common/stringbundle.js");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
|
@ -1,7 +1,7 @@
|
||||
const Cm = Components.manager;
|
||||
|
||||
// Shared logging for all HTTP server functions.
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
const SYNC_HTTP_LOGGER = "Sync.Test.Server";
|
||||
const SYNC_API_VERSION = "1.1";
|
||||
|
||||
@ -163,7 +163,7 @@ function ServerCollection(wbos, acceptNew, timestamp) {
|
||||
* has a modified time.
|
||||
*/
|
||||
this.timestamp = timestamp || new_timestamp();
|
||||
this._log = Log4Moz.repository.getLogger(SYNC_HTTP_LOGGER);
|
||||
this._log = Log.repository.getLogger(SYNC_HTTP_LOGGER);
|
||||
}
|
||||
ServerCollection.prototype = {
|
||||
|
||||
@ -527,7 +527,7 @@ function SyncServer(callback) {
|
||||
this.server = new HttpServer();
|
||||
this.started = false;
|
||||
this.users = {};
|
||||
this._log = Log4Moz.repository.getLogger(SYNC_HTTP_LOGGER);
|
||||
this._log = Log.repository.getLogger(SYNC_HTTP_LOGGER);
|
||||
|
||||
// Install our own default handler. This allows us to mess around with the
|
||||
// whole URL space.
|
||||
|
@ -240,13 +240,13 @@ add_test(function cleanup() {
|
||||
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.Engine.Addons").level =
|
||||
Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.Store.Addons").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.Tracker.Addons").level =
|
||||
Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.AddonsRepository").level =
|
||||
Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Engine.Addons").level =
|
||||
Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Store.Addons").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Tracker.Addons").level =
|
||||
Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.AddonsRepository").level =
|
||||
Log.Level.Trace;
|
||||
|
||||
reconciler.startListening();
|
||||
|
||||
|
@ -14,9 +14,9 @@ startupManager();
|
||||
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.AddonsReconciler").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.AddonsReconciler").level =
|
||||
Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.AddonsReconciler").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.AddonsReconciler").level =
|
||||
Log.Level.Trace;
|
||||
|
||||
Svc.Prefs.set("engine.addons", true);
|
||||
Service.engineManager.register(AddonsEngine);
|
||||
|
@ -67,9 +67,9 @@ function createAndStartHTTPServer(port) {
|
||||
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.Engine.Addons").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.AddonsRepository").level =
|
||||
Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Engine.Addons").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.AddonsRepository").level =
|
||||
Log.Level.Trace;
|
||||
|
||||
reconciler.startListening();
|
||||
|
||||
|
@ -43,9 +43,9 @@ function cleanup_and_advance() {
|
||||
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.Engine.Addons").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.AddonsReconciler").level =
|
||||
Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Engine.Addons").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.AddonsReconciler").level =
|
||||
Log.Level.Trace;
|
||||
|
||||
cleanup_and_advance();
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
Cu.import("resource://gre/modules/PlacesUtils.jsm");
|
||||
Cu.import("resource://gre/modules/BookmarkJSONUtils.jsm");
|
||||
Cu.import("resource://services-common/async.js");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/engines.js");
|
||||
Cu.import("resource://services-sync/engines/bookmarks.js");
|
||||
Cu.import("resource://services-sync/service.js");
|
||||
|
@ -6,7 +6,7 @@ Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
Cu.import("resource://gre/modules/PlacesUtils.jsm");
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/engines.js");
|
||||
Cu.import("resource://services-sync/engines/bookmarks.js");
|
||||
Cu.import("resource://services-sync/record.js");
|
||||
@ -45,7 +45,7 @@ function run_test() {
|
||||
store.wipe();
|
||||
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.Engine.Bookmarks").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Engine.Bookmarks").level = Log.Level.Trace;
|
||||
|
||||
_("Create a microsummarized bookmark.");
|
||||
let id = newMicrosummary(TEST_URL, TEST_TITLE);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/record.js");
|
||||
Cu.import("resource://services-sync/engines.js");
|
||||
Cu.import("resource://services-sync/engines/bookmarks.js");
|
||||
@ -70,8 +70,8 @@ function makeLivemark(p, mintGUID) {
|
||||
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.Engine.Bookmarks").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.Store.Bookmarks").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Engine.Bookmarks").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Store.Bookmarks").level = Log.Level.Trace;
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
@ -11,8 +11,8 @@ let store = engine._store;
|
||||
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.Engine.Bookmarks").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.Store.Bookmarks").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Engine.Bookmarks").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Store.Bookmarks").level = Log.Level.Trace;
|
||||
|
||||
let tagRecord = new BookmarkQuery("bookmarks", "abcdefabcdef");
|
||||
let uri = "place:folder=499&type=7&queryType=1";
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/engines/bookmarks.js");
|
||||
Cu.import("resource://services-sync/keys.js");
|
||||
Cu.import("resource://services-sync/record.js");
|
||||
@ -20,8 +20,8 @@ function run_test() {
|
||||
generateNewKeys(Service.collectionKeys);
|
||||
let keyBundle = Service.identity.syncKeyBundle;
|
||||
|
||||
let log = Log4Moz.repository.getLogger("Test");
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
let log = Log.repository.getLogger("Test");
|
||||
Log.repository.rootLogger.addAppender(new Log.DumpAppender());
|
||||
|
||||
log.info("Creating a record");
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://gre/modules/PlacesUtils.jsm");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/engines.js");
|
||||
Cu.import("resource://services-sync/engines/bookmarks.js");
|
||||
Cu.import("resource://services-sync/service.js");
|
||||
@ -227,7 +227,7 @@ add_test(function test_smart_bookmarks_duped() {
|
||||
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.Engine.Bookmarks").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Engine.Bookmarks").level = Log.Level.Trace;
|
||||
|
||||
generateNewKeys(Service.collectionKeys);
|
||||
|
||||
|
@ -167,9 +167,9 @@ function test_onItemMoved() {
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
|
||||
Log4Moz.repository.getLogger("Sync.Engine.Bookmarks").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.Store.Bookmarks").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.Tracker.Bookmarks").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Engine.Bookmarks").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Store.Bookmarks").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Tracker.Bookmarks").level = Log.Level.Trace;
|
||||
|
||||
test_tracking();
|
||||
test_onItemChanged();
|
||||
|
@ -551,6 +551,6 @@ add_test(function test_receive_display_uri() {
|
||||
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.Engine.Clients").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Engine.Clients").level = Log.Level.Trace;
|
||||
run_next_test();
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/engines.js");
|
||||
Cu.import("resource://services-sync/engines/tabs.js");
|
||||
@ -203,8 +203,8 @@ add_task(function test_locally_changed_keys() {
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
let logger = Log4Moz.repository.rootLogger;
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
let logger = Log.repository.rootLogger;
|
||||
Log.repository.rootLogger.addAppender(new Log.DumpAppender());
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
@ -51,9 +51,9 @@ let errorHandler = Service.errorHandler;
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
|
||||
Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.SyncScheduler").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.ErrorHandler").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.SyncScheduler").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.ErrorHandler").level = Log.Level.Trace;
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
@ -1583,7 +1583,7 @@ add_test(function test_sync_engine_generic_fail() {
|
||||
Svc.Obs.notify("weave:engine:sync:error", "", "catapult");
|
||||
};
|
||||
|
||||
let log = Log4Moz.repository.getLogger("Sync.ErrorHandler");
|
||||
let log = Log.repository.getLogger("Sync.ErrorHandler");
|
||||
Svc.Prefs.set("log.appender.file.logOnError", true);
|
||||
|
||||
do_check_eq(Status.engines["catapult"], undefined);
|
||||
@ -1623,7 +1623,7 @@ add_test(function test_logs_on_sync_error_despite_shouldReportError() {
|
||||
_("Ensure that an error is still logged when weave:service:sync:error " +
|
||||
"is notified, despite shouldReportError returning false.");
|
||||
|
||||
let log = Log4Moz.repository.getLogger("Sync.ErrorHandler");
|
||||
let log = Log.repository.getLogger("Sync.ErrorHandler");
|
||||
Svc.Prefs.set("log.appender.file.logOnError", true);
|
||||
log.info("TESTING");
|
||||
|
||||
@ -1651,7 +1651,7 @@ add_test(function test_logs_on_login_error_despite_shouldReportError() {
|
||||
_("Ensure that an error is still logged when weave:service:login:error " +
|
||||
"is notified, despite shouldReportError returning false.");
|
||||
|
||||
let log = Log4Moz.repository.getLogger("Sync.ErrorHandler");
|
||||
let log = Log.repository.getLogger("Sync.ErrorHandler");
|
||||
Svc.Prefs.set("log.appender.file.logOnError", true);
|
||||
log.info("TESTING");
|
||||
|
||||
@ -1687,7 +1687,7 @@ add_test(function test_engine_applyFailed() {
|
||||
Svc.Obs.notify("weave:engine:sync:applied", {newFailed:1}, "catapult");
|
||||
};
|
||||
|
||||
let log = Log4Moz.repository.getLogger("Sync.ErrorHandler");
|
||||
let log = Log.repository.getLogger("Sync.ErrorHandler");
|
||||
Svc.Prefs.set("log.appender.file.logOnError", true);
|
||||
|
||||
Svc.Obs.add("weave:service:reset-file-log", function onResetFileLog() {
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/utils.js");
|
||||
Cu.import("resource://services-sync/service.js");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
@ -29,16 +29,16 @@ function setLastSync(lastSyncValue) {
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
|
||||
Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.SyncScheduler").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.ErrorHandler").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.SyncScheduler").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.ErrorHandler").level = Log.Level.Trace;
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
add_test(function test_noOutput() {
|
||||
// Ensure that the log appender won't print anything.
|
||||
errorHandler._logAppender.level = Log4Moz.Level.Fatal + 1;
|
||||
errorHandler._logAppender.level = Log.Level.Fatal + 1;
|
||||
|
||||
// Clear log output from startup.
|
||||
Svc.Prefs.set("log.appender.file.logOnSuccess", false);
|
||||
@ -50,7 +50,7 @@ add_test(function test_noOutput() {
|
||||
Svc.Obs.add("weave:service:reset-file-log", function onResetFileLog() {
|
||||
Svc.Obs.remove("weave:service:reset-file-log", onResetFileLog);
|
||||
|
||||
errorHandler._logAppender.level = Log4Moz.Level.Trace;
|
||||
errorHandler._logAppender.level = Log.Level.Trace;
|
||||
Svc.Prefs.resetBranch("");
|
||||
run_next_test();
|
||||
});
|
||||
@ -62,7 +62,7 @@ add_test(function test_noOutput() {
|
||||
add_test(function test_logOnSuccess_false() {
|
||||
Svc.Prefs.set("log.appender.file.logOnSuccess", false);
|
||||
|
||||
let log = Log4Moz.repository.getLogger("Sync.Test.FileLog");
|
||||
let log = Log.repository.getLogger("Sync.Test.FileLog");
|
||||
log.info("this won't show up");
|
||||
|
||||
Svc.Obs.add("weave:service:reset-file-log", function onResetFileLog() {
|
||||
@ -89,7 +89,7 @@ function readFile(file, callback) {
|
||||
add_test(function test_logOnSuccess_true() {
|
||||
Svc.Prefs.set("log.appender.file.logOnSuccess", true);
|
||||
|
||||
let log = Log4Moz.repository.getLogger("Sync.Test.FileLog");
|
||||
let log = Log.repository.getLogger("Sync.Test.FileLog");
|
||||
const MESSAGE = "this WILL show up";
|
||||
log.info(MESSAGE);
|
||||
|
||||
@ -130,7 +130,7 @@ add_test(function test_logOnSuccess_true() {
|
||||
add_test(function test_sync_error_logOnError_false() {
|
||||
Svc.Prefs.set("log.appender.file.logOnError", false);
|
||||
|
||||
let log = Log4Moz.repository.getLogger("Sync.Test.FileLog");
|
||||
let log = Log.repository.getLogger("Sync.Test.FileLog");
|
||||
log.info("this won't show up");
|
||||
|
||||
Svc.Obs.add("weave:service:reset-file-log", function onResetFileLog() {
|
||||
@ -150,7 +150,7 @@ add_test(function test_sync_error_logOnError_false() {
|
||||
add_test(function test_sync_error_logOnError_true() {
|
||||
Svc.Prefs.set("log.appender.file.logOnError", true);
|
||||
|
||||
let log = Log4Moz.repository.getLogger("Sync.Test.FileLog");
|
||||
let log = Log.repository.getLogger("Sync.Test.FileLog");
|
||||
const MESSAGE = "this WILL show up";
|
||||
log.info(MESSAGE);
|
||||
|
||||
@ -192,7 +192,7 @@ add_test(function test_sync_error_logOnError_true() {
|
||||
add_test(function test_login_error_logOnError_false() {
|
||||
Svc.Prefs.set("log.appender.file.logOnError", false);
|
||||
|
||||
let log = Log4Moz.repository.getLogger("Sync.Test.FileLog");
|
||||
let log = Log.repository.getLogger("Sync.Test.FileLog");
|
||||
log.info("this won't show up");
|
||||
|
||||
Svc.Obs.add("weave:service:reset-file-log", function onResetFileLog() {
|
||||
@ -212,7 +212,7 @@ add_test(function test_login_error_logOnError_false() {
|
||||
add_test(function test_login_error_logOnError_true() {
|
||||
Svc.Prefs.set("log.appender.file.logOnError", true);
|
||||
|
||||
let log = Log4Moz.repository.getLogger("Sync.Test.FileLog");
|
||||
let log = Log.repository.getLogger("Sync.Test.FileLog");
|
||||
const MESSAGE = "this WILL show up";
|
||||
log.info(MESSAGE);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/engines/forms.js");
|
||||
Cu.import("resource://services-sync/service.js");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
@ -14,7 +14,7 @@ function run_test() {
|
||||
tracker.persistChangedIDs = false;
|
||||
|
||||
do_check_empty(tracker.changedIDs);
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
Log.repository.rootLogger.addAppender(new Log.DumpAppender());
|
||||
|
||||
function addEntry(name, value) {
|
||||
engine._store.create({name: name, value: value});
|
||||
|
@ -64,7 +64,7 @@ function addVisit() {
|
||||
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.Tracker.History").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Tracker.History").level = Log.Level.Trace;
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
|
||||
function run_test() {
|
||||
Log4Moz.repository.getLogger("Sync.Test.Server").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Test.Server").level = Log.Level.Trace;
|
||||
initTestLogging();
|
||||
run_next_test();
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ let identity = new IdentityManager();
|
||||
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.Identity").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Identity").level = Log.Level.Trace;
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
@ -49,8 +49,8 @@ function setUp(server) {
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
|
||||
Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.SyncScheduler").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.SyncScheduler").level = Log.Level.Trace;
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/identity.js");
|
||||
Cu.import("resource://services-sync/jpakeclient.js");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
@ -189,9 +189,9 @@ function run_test() {
|
||||
setBasicCredentials("johndoe", "ilovejane");
|
||||
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.JPAKEClient").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Common.RESTRequest").level =
|
||||
Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.JPAKEClient").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Common.RESTRequest").level =
|
||||
Log.Level.Trace;
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
|
@ -172,8 +172,8 @@ add_test(function test_keymanager() {
|
||||
});
|
||||
|
||||
add_test(function test_collections_manager() {
|
||||
let log = Log4Moz.repository.getLogger("Test");
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
let log = Log.repository.getLogger("Test");
|
||||
Log.repository.rootLogger.addAppender(new Log.DumpAppender());
|
||||
|
||||
let identity = new IdentityManager();
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
_("Test that node reassignment responses are respected on all kinds of " +
|
||||
"requests.");
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/rest.js");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/service.js");
|
||||
@ -16,12 +16,12 @@ Cu.import("resource://testing-common/services/sync/utils.js");
|
||||
Service.engineManager.clear();
|
||||
|
||||
function run_test() {
|
||||
Log4Moz.repository.getLogger("Sync.AsyncResource").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.ErrorHandler").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.Resource").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.RESTRequest").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.SyncScheduler").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.AsyncResource").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.ErrorHandler").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Resource").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.RESTRequest").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.SyncScheduler").level = Log.Level.Trace;
|
||||
initTestLogging();
|
||||
|
||||
Service.engineManager.register(RotaryEngine);
|
||||
|
@ -7,8 +7,8 @@ Cu.import("resource://services-sync/util.js");
|
||||
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.Engine.Passwords").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.Store.Passwords").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Engine.Passwords").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Store.Passwords").level = Log.Level.Trace;
|
||||
|
||||
const BOGUS_GUID_A = "zzzzzzzzzzzz";
|
||||
const BOGUS_GUID_B = "yyyyyyyyyyyy";
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/keys.js");
|
||||
Cu.import("resource://services-sync/record.js");
|
||||
@ -35,8 +35,8 @@ function run_test() {
|
||||
let keyBundle = Service.identity.syncKeyBundle;
|
||||
|
||||
try {
|
||||
let log = Log4Moz.repository.getLogger("Test");
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
let log = Log.repository.getLogger("Test");
|
||||
Log.repository.rootLogger.addAppender(new Log.DumpAppender());
|
||||
|
||||
log.info("Setting up server and authenticator");
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/observers.js");
|
||||
Cu.import("resource://services-sync/identity.js");
|
||||
Cu.import("resource://services-sync/resource.js");
|
||||
@ -153,8 +153,8 @@ function run_test() {
|
||||
|
||||
do_test_pending();
|
||||
|
||||
logger = Log4Moz.repository.getLogger('Test');
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
logger = Log.repository.getLogger('Test');
|
||||
Log.repository.rootLogger.addAppender(new Log.DumpAppender());
|
||||
|
||||
let server = httpd_setup({
|
||||
"/open": server_open,
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-common/observers.js");
|
||||
Cu.import("resource://services-sync/identity.js");
|
||||
Cu.import("resource://services-sync/resource.js");
|
||||
@ -153,8 +153,8 @@ Observers.add("weave:service:quota:remaining",
|
||||
function (subject) { quotaValue = subject; });
|
||||
|
||||
function run_test() {
|
||||
logger = Log4Moz.repository.getLogger('Test');
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
logger = Log.repository.getLogger('Test');
|
||||
Log.repository.rootLogger.addAppender(new Log.DumpAppender());
|
||||
|
||||
Svc.Prefs.set("network.numRetries", 1); // speed up test
|
||||
run_next_test();
|
||||
|
@ -24,7 +24,7 @@ function uaHandler(f) {
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
Log.repository.rootLogger.addAppender(new Log.DumpAppender());
|
||||
meta_global = new ServerWBO('global');
|
||||
server = httpd_setup({
|
||||
"/1.1/johndoe/info/collections": uaHandler(collectionsHelper.handler),
|
||||
|
@ -50,7 +50,7 @@ function setUp(server) {
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
|
||||
Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
@ -12,8 +12,8 @@ function run_test() {
|
||||
Service.serverURL = "http://weave.server/";
|
||||
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.SendCredentialsController").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.SyncScheduler").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.SendCredentialsController").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.SyncScheduler").level = Log.Level.Trace;
|
||||
run_next_test();
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/service.js");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
@ -9,9 +9,9 @@ Cu.import("resource://testing-common/services/sync/utils.js");
|
||||
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.AsyncResource").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.Resource").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.AsyncResource").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Resource").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/keys.js");
|
||||
Cu.import("resource://services-sync/engines/tabs.js");
|
||||
@ -292,8 +292,8 @@ add_test(function v5_upgrade() {
|
||||
});
|
||||
|
||||
function run_test() {
|
||||
let logger = Log4Moz.repository.rootLogger;
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
let logger = Log.repository.rootLogger;
|
||||
Log.repository.rootLogger.addAppender(new Log.DumpAppender());
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
@ -12,8 +12,8 @@ let collections = {steam: 65.11328,
|
||||
diesel: 2.25488281};
|
||||
|
||||
function run_test() {
|
||||
Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.StorageRequest").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.StorageRequest").level = Log.Level.Trace;
|
||||
initTestLogging();
|
||||
|
||||
setBasicCredentials("johndoe", "ilovejane");
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/service.js");
|
||||
Cu.import("resource://services-sync/policies.js");
|
||||
@ -23,8 +23,8 @@ function login_handling(handler) {
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
let logger = Log4Moz.repository.rootLogger;
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
let logger = Log.repository.rootLogger;
|
||||
Log.repository.rootLogger.addAppender(new Log.DumpAppender());
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
@ -20,8 +20,8 @@ function login_handling(handler) {
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
let logger = Log4Moz.repository.rootLogger;
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
let logger = Log.repository.rootLogger;
|
||||
Log.repository.rootLogger.addAppender(new Log.DumpAppender());
|
||||
|
||||
let collectionsHelper = track_collections_helper();
|
||||
let upd = collectionsHelper.with_updated_collection;
|
||||
|
@ -16,7 +16,7 @@ function run_test() {
|
||||
return old;
|
||||
}
|
||||
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
Log.repository.rootLogger.addAppender(new Log.DumpAppender());
|
||||
|
||||
augmentLogger(Service._log);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/keys.js");
|
||||
Cu.import("resource://services-sync/service.js");
|
||||
@ -10,8 +10,8 @@ Cu.import("resource://testing-common/services/sync/fakeservices.js");
|
||||
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||
|
||||
function run_test() {
|
||||
let logger = Log4Moz.repository.rootLogger;
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
let logger = Log.repository.rootLogger;
|
||||
Log.repository.rootLogger.addAppender(new Log.DumpAppender());
|
||||
|
||||
let guidSvc = new FakeGUIDService();
|
||||
let clients = new ServerCollection();
|
||||
|
@ -82,8 +82,8 @@ const PAYLOAD = 42;
|
||||
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.ErrorHandler").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.ErrorHandler").level = Log.Level.Trace;
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/service.js");
|
||||
Cu.import("resource://services-sync/util.js");
|
||||
@ -27,8 +27,8 @@ function service_unavailable(request, response) {
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
let logger = Log4Moz.repository.rootLogger;
|
||||
Log4Moz.repository.rootLogger.addAppender(new Log4Moz.DumpAppender());
|
||||
let logger = Log.repository.rootLogger;
|
||||
Log.repository.rootLogger.addAppender(new Log.DumpAppender());
|
||||
|
||||
// This test expects a clean slate -- no saved passphrase.
|
||||
Services.logins.removeAllLogins();
|
||||
|
@ -76,8 +76,8 @@ function cleanUpAndGo(server) {
|
||||
function run_test() {
|
||||
initTestLogging("Trace");
|
||||
|
||||
Log4Moz.repository.getLogger("Sync.Service").level = Log4Moz.Level.Trace;
|
||||
Log4Moz.repository.getLogger("Sync.scheduler").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.Service").level = Log.Level.Trace;
|
||||
Log.repository.getLogger("Sync.scheduler").level = Log.Level.Trace;
|
||||
|
||||
run_next_test();
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
Cu.import("resource://services-sync/constants.js");
|
||||
Cu.import("resource://services-sync/rest.js");
|
||||
Cu.import("resource://services-sync/service.js");
|
||||
@ -9,7 +9,7 @@ Cu.import("resource://services-sync/util.js");
|
||||
Cu.import("resource://testing-common/services/sync/utils.js");
|
||||
|
||||
function run_test() {
|
||||
Log4Moz.repository.getLogger("Sync.RESTRequest").level = Log4Moz.Level.Trace;
|
||||
Log.repository.getLogger("Sync.RESTRequest").level = Log.Level.Trace;
|
||||
initTestLogging();
|
||||
|
||||
run_next_test();
|
||||
|
@ -19,7 +19,7 @@ this.ServerSocket = CC("@mozilla.org/network/server-socket;1",
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/FileUtils.jsm");
|
||||
Cu.import("resource://gre/modules/services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
|
||||
let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
.getService(Ci.mozIJSSubScriptLoader);
|
||||
@ -29,13 +29,13 @@ function MarionetteComponent() {
|
||||
this.observerService = Services.obs;
|
||||
|
||||
// set up the logger
|
||||
this.logger = Log4Moz.repository.getLogger("Marionette");
|
||||
this.logger.level = Log4Moz.Level["Trace"];
|
||||
this.logger = Log.repository.getLogger("Marionette");
|
||||
this.logger.level = Log.Level["Trace"];
|
||||
let logf = FileUtils.getFile('ProfD', ['marionette.log']);
|
||||
|
||||
let dumper = false;
|
||||
let formatter = new Log4Moz.BasicFormatter();
|
||||
this.logger.addAppender(new Log4Moz.BoundedFileAppender(logf.path, formatter));
|
||||
let formatter = new Log.BasicFormatter();
|
||||
this.logger.addAppender(new Log.BoundedFileAppender(logf.path, formatter));
|
||||
#ifdef DEBUG
|
||||
dumper = true;
|
||||
#endif
|
||||
@ -43,7 +43,7 @@ function MarionetteComponent() {
|
||||
dumper = true;
|
||||
#endif
|
||||
if (dumper) {
|
||||
this.logger.addAppender(new Log4Moz.DumpAppender(formatter));
|
||||
this.logger.addAppender(new Log.DumpAppender(formatter));
|
||||
}
|
||||
this.logger.info("MarionetteComponent loaded");
|
||||
}
|
||||
|
@ -10,8 +10,8 @@ let FRAME_SCRIPT = "chrome://marionette/content/marionette-listener.js";
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
Cu.import("resource://gre/modules/services-common/log4moz.js");
|
||||
let logger = Log4Moz.repository.getLogger("Marionette");
|
||||
Cu.import("resource://gre/modules/services-common/Log.js");
|
||||
let logger = Log.repository.getLogger("Marionette");
|
||||
|
||||
//list of OOP frames that has the frame script loaded
|
||||
let remoteFrames = [];
|
||||
|
@ -72,8 +72,8 @@ let isTap = false;
|
||||
// whether to send mouse event
|
||||
let mouseEventsOnly = false;
|
||||
|
||||
Cu.import("resource://gre/modules/services-common/log4moz.js");
|
||||
let logger = Log4Moz.repository.getLogger("Marionette");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
let logger = Log.repository.getLogger("Marionette");
|
||||
logger.info("loaded marionette-listener.js");
|
||||
let modalHandler = function() {
|
||||
sendSyncMessage("Marionette:switchedToFrame", { frameValue: null, storePrevious: true });
|
||||
|
@ -7,8 +7,8 @@
|
||||
const FRAME_SCRIPT = "chrome://marionette/content/marionette-listener.js";
|
||||
|
||||
// import logger
|
||||
Cu.import("resource://gre/modules/services-common/log4moz.js");
|
||||
let logger = Log4Moz.repository.getLogger("Marionette");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
let logger = Log.repository.getLogger("Marionette");
|
||||
logger.info('marionette-server.js loaded');
|
||||
|
||||
let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"]
|
||||
|
@ -24,7 +24,7 @@ function percentEncode(aString)
|
||||
* parameters: the responseText and the XHR object.
|
||||
* onError, a function handle to call when an error occcurs, it takes three
|
||||
* parameters: the error, the responseText and the XHR object.
|
||||
* logger, an object that implements the debug and log methods (e.g. log4moz).
|
||||
* logger, an object that implements the debug and log methods (e.g. log.jsm).
|
||||
*
|
||||
* Headers or post data are given as an array of arrays, for each each inner
|
||||
* array the first value is the key and the second is the value, e.g.
|
||||
|
@ -1,9 +1,10 @@
|
||||
/* 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 = ['Log4Moz'];
|
||||
this.EXPORTED_SYMBOLS = ["Log"];
|
||||
|
||||
const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
|
||||
|
||||
@ -20,7 +21,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "OS",
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Task",
|
||||
"resource://gre/modules/Task.jsm");
|
||||
|
||||
this.Log4Moz = {
|
||||
this.Log = {
|
||||
Level: {
|
||||
Fatal: 70,
|
||||
Error: 60,
|
||||
@ -53,13 +54,13 @@ this.Log4Moz = {
|
||||
},
|
||||
|
||||
get repository() {
|
||||
delete Log4Moz.repository;
|
||||
Log4Moz.repository = new LoggerRepository();
|
||||
return Log4Moz.repository;
|
||||
delete Log.repository;
|
||||
Log.repository = new LoggerRepository();
|
||||
return Log.repository;
|
||||
},
|
||||
set repository(value) {
|
||||
delete Log4Moz.repository;
|
||||
Log4Moz.repository = value;
|
||||
delete Log.repository;
|
||||
Log.repository = value;
|
||||
},
|
||||
|
||||
LogMessage: LogMessage,
|
||||
@ -79,9 +80,9 @@ this.Log4Moz = {
|
||||
BoundedFileAppender: BoundedFileAppender,
|
||||
|
||||
// Logging helper:
|
||||
// let logger = Log4Moz.repository.getLogger("foo");
|
||||
// logger.info(Log4Moz.enumerateInterfaces(someObject).join(","));
|
||||
enumerateInterfaces: function Log4Moz_enumerateInterfaces(aObject) {
|
||||
// let logger = Log.repository.getLogger("foo");
|
||||
// logger.info(Log.enumerateInterfaces(someObject).join(","));
|
||||
enumerateInterfaces: function Log_enumerateInterfaces(aObject) {
|
||||
let interfaces = [];
|
||||
|
||||
for (i in Ci) {
|
||||
@ -96,9 +97,9 @@ this.Log4Moz = {
|
||||
},
|
||||
|
||||
// Logging helper:
|
||||
// let logger = Log4Moz.repository.getLogger("foo");
|
||||
// logger.info(Log4Moz.enumerateProperties(someObject).join(","));
|
||||
enumerateProperties: function Log4Moz_enumerateProps(aObject,
|
||||
// let logger = Log.repository.getLogger("foo");
|
||||
// logger.info(Log.enumerateProperties(someObject).join(","));
|
||||
enumerateProperties: function Log_enumerateProps(aObject,
|
||||
aExcludeComplexTypes) {
|
||||
let properties = [];
|
||||
|
||||
@ -136,8 +137,8 @@ function LogMessage(loggerName, level, message, params) {
|
||||
}
|
||||
LogMessage.prototype = {
|
||||
get levelDesc() {
|
||||
if (this.level in Log4Moz.Level.Desc)
|
||||
return Log4Moz.Level.Desc[this.level];
|
||||
if (this.level in Log.Level.Desc)
|
||||
return Log.Level.Desc[this.level];
|
||||
return "UNKNOWN";
|
||||
},
|
||||
|
||||
@ -158,7 +159,7 @@ LogMessage.prototype = {
|
||||
|
||||
function Logger(name, repository) {
|
||||
if (!repository)
|
||||
repository = Log4Moz.repository;
|
||||
repository = Log.repository;
|
||||
this._name = name;
|
||||
this.children = [];
|
||||
this.ownAppenders = [];
|
||||
@ -176,8 +177,8 @@ Logger.prototype = {
|
||||
return this._level;
|
||||
if (this.parent)
|
||||
return this.parent.level;
|
||||
dump("log4moz warning: root logger configuration error: no level defined\n");
|
||||
return Log4Moz.Level.All;
|
||||
dump("Log warning: root logger configuration error: no level defined\n");
|
||||
return Log.Level.All;
|
||||
},
|
||||
set level(level) {
|
||||
this._level = level;
|
||||
@ -258,8 +259,8 @@ Logger.prototype = {
|
||||
}
|
||||
|
||||
let level = params._level || this.level;
|
||||
if ((typeof level == "string") && level in Log4Moz.Level.Numbers) {
|
||||
level = Log4Moz.Level.Numbers[level];
|
||||
if ((typeof level == "string") && level in Log.Level.Numbers) {
|
||||
level = Log.Level.Numbers[level];
|
||||
}
|
||||
|
||||
params.action = action;
|
||||
@ -286,25 +287,25 @@ Logger.prototype = {
|
||||
},
|
||||
|
||||
fatal: function (string, params) {
|
||||
this.log(Log4Moz.Level.Fatal, string, params);
|
||||
this.log(Log.Level.Fatal, string, params);
|
||||
},
|
||||
error: function (string, params) {
|
||||
this.log(Log4Moz.Level.Error, string, params);
|
||||
this.log(Log.Level.Error, string, params);
|
||||
},
|
||||
warn: function (string, params) {
|
||||
this.log(Log4Moz.Level.Warn, string, params);
|
||||
this.log(Log.Level.Warn, string, params);
|
||||
},
|
||||
info: function (string, params) {
|
||||
this.log(Log4Moz.Level.Info, string, params);
|
||||
this.log(Log.Level.Info, string, params);
|
||||
},
|
||||
config: function (string, params) {
|
||||
this.log(Log4Moz.Level.Config, string, params);
|
||||
this.log(Log.Level.Config, string, params);
|
||||
},
|
||||
debug: function (string, params) {
|
||||
this.log(Log4Moz.Level.Debug, string, params);
|
||||
this.log(Log.Level.Debug, string, params);
|
||||
},
|
||||
trace: function (string, params) {
|
||||
this.log(Log4Moz.Level.Trace, string, params);
|
||||
this.log(Log.Level.Trace, string, params);
|
||||
}
|
||||
};
|
||||
|
||||
@ -321,7 +322,7 @@ LoggerRepository.prototype = {
|
||||
get rootLogger() {
|
||||
if (!this._rootLogger) {
|
||||
this._rootLogger = new Logger("root", this);
|
||||
this._rootLogger.level = Log4Moz.Level.All;
|
||||
this._rootLogger.level = Log.Level.All;
|
||||
}
|
||||
return this._rootLogger;
|
||||
},
|
||||
@ -436,7 +437,7 @@ function Appender(formatter) {
|
||||
this._formatter = formatter? formatter : new BasicFormatter();
|
||||
}
|
||||
Appender.prototype = {
|
||||
level: Log4Moz.Level.All,
|
||||
level: Log.Level.All,
|
||||
|
||||
append: function App_append(message) {
|
||||
if (message) {
|
||||
@ -480,7 +481,7 @@ ConsoleAppender.prototype = {
|
||||
__proto__: Appender.prototype,
|
||||
|
||||
doAppend: function CApp_doAppend(message) {
|
||||
if (message.level > Log4Moz.Level.Warn) {
|
||||
if (message.level > Log.Level.Warn) {
|
||||
Cu.reportError(message);
|
||||
return;
|
||||
}
|
@ -14,7 +14,7 @@ Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
|
||||
Cu.import("resource://gre/modules/osfile.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
|
||||
"resource://gre/modules/AsyncShutdown.jsm");
|
||||
@ -66,7 +66,7 @@ let connectionCounters = new Map();
|
||||
* @return Promise<OpenedConnection>
|
||||
*/
|
||||
function openConnection(options) {
|
||||
let log = Log4Moz.repository.getLogger("Sqlite.ConnectionOpener");
|
||||
let log = Log.repository.getLogger("Sqlite.ConnectionOpener");
|
||||
|
||||
if (!options.path) {
|
||||
throw new Error("path not specified in connection options.");
|
||||
@ -173,7 +173,7 @@ function openConnection(options) {
|
||||
* `openConnection`.
|
||||
*/
|
||||
function OpenedConnection(connection, basename, number, options) {
|
||||
let log = Log4Moz.repository.getLogger("Sqlite.Connection." + basename);
|
||||
let log = Log.repository.getLogger("Sqlite.Connection." + basename);
|
||||
|
||||
// getLogger() returns a shared object. We can't modify the functions on this
|
||||
// object since they would have effect on all instances and last write would
|
||||
@ -183,7 +183,7 @@ function OpenedConnection(connection, basename, number, options) {
|
||||
let logProxy = {__proto__: log};
|
||||
|
||||
// Automatically prefix all log messages with the identifier.
|
||||
for (let level in Log4Moz.Level) {
|
||||
for (let level in Log.Level) {
|
||||
if (level == "Desc") {
|
||||
continue;
|
||||
}
|
||||
@ -745,7 +745,7 @@ OpenedConnection.prototype = Object.freeze({
|
||||
|
||||
// Don't incur overhead for serializing params unless the messages go
|
||||
// somewhere.
|
||||
if (this._log.level <= Log4Moz.Level.Trace) {
|
||||
if (this._log.level <= Log.Level.Trace) {
|
||||
let msg = "Stmt #" + index + " " + sql;
|
||||
|
||||
if (params) {
|
||||
|
@ -17,6 +17,7 @@ EXTRA_JS_MODULES += [
|
||||
'Http.jsm',
|
||||
'InlineSpellChecker.jsm',
|
||||
'LoadContextInfo.jsm',
|
||||
'Log.jsm',
|
||||
'NewTabUtils.jsm',
|
||||
'PageMenu.jsm',
|
||||
'PermissionsUtils.jsm',
|
||||
|
@ -1,10 +1,12 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
const {utils: Cu} = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||
Cu.import("resource://gre/modules/osfile.jsm");
|
||||
|
||||
Cu.import("resource://services-common/log4moz.js");
|
||||
Cu.import("resource://gre/modules/Log.jsm");
|
||||
|
||||
let testFormatter = {
|
||||
format: function format(message) {
|
||||
@ -15,11 +17,11 @@ let testFormatter = {
|
||||
};
|
||||
|
||||
function MockAppender(formatter) {
|
||||
Log4Moz.Appender.call(this, formatter);
|
||||
Log.Appender.call(this, formatter);
|
||||
this.messages = [];
|
||||
}
|
||||
MockAppender.prototype = {
|
||||
__proto__: Log4Moz.Appender.prototype,
|
||||
__proto__: Log.Appender.prototype,
|
||||
|
||||
doAppend: function DApp_doAppend(message) {
|
||||
this.messages.push(message);
|
||||
@ -31,11 +33,11 @@ function run_test() {
|
||||
}
|
||||
|
||||
add_test(function test_Logger() {
|
||||
let log = Log4Moz.repository.getLogger("test.logger");
|
||||
let appender = new MockAppender(new Log4Moz.BasicFormatter());
|
||||
let log = Log.repository.getLogger("test.logger");
|
||||
let appender = new MockAppender(new Log.BasicFormatter());
|
||||
|
||||
log.level = Log4Moz.Level.Debug;
|
||||
appender.level = Log4Moz.Level.Info;
|
||||
log.level = Log.Level.Debug;
|
||||
appender.level = Log.Level.Info;
|
||||
log.addAppender(appender);
|
||||
log.info("info test");
|
||||
log.debug("this should be logged but not appended.");
|
||||
@ -50,19 +52,19 @@ add_test(function test_Logger() {
|
||||
|
||||
add_test(function test_Logger_parent() {
|
||||
// Check whether parenting is correct
|
||||
let grandparentLog = Log4Moz.repository.getLogger("grandparent");
|
||||
let childLog = Log4Moz.repository.getLogger("grandparent.parent.child");
|
||||
let grandparentLog = Log.repository.getLogger("grandparent");
|
||||
let childLog = Log.repository.getLogger("grandparent.parent.child");
|
||||
do_check_eq(childLog.parent.name, "grandparent");
|
||||
|
||||
let parentLog = Log4Moz.repository.getLogger("grandparent.parent");
|
||||
let parentLog = Log.repository.getLogger("grandparent.parent");
|
||||
do_check_eq(childLog.parent.name, "grandparent.parent");
|
||||
|
||||
// Check that appends are exactly in scope
|
||||
let gpAppender = new MockAppender(new Log4Moz.BasicFormatter());
|
||||
gpAppender.level = Log4Moz.Level.Info;
|
||||
let gpAppender = new MockAppender(new Log.BasicFormatter());
|
||||
gpAppender.level = Log.Level.Info;
|
||||
grandparentLog.addAppender(gpAppender);
|
||||
childLog.info("child info test");
|
||||
Log4Moz.repository.rootLogger.info("this shouldn't show up in gpAppender");
|
||||
Log.repository.rootLogger.info("this shouldn't show up in gpAppender");
|
||||
|
||||
do_check_eq(gpAppender.messages.length, 1);
|
||||
do_check_true(gpAppender.messages[0].indexOf("child info test") > 0);
|
||||
@ -96,17 +98,17 @@ function checkObjects(expected, actual) {
|
||||
}
|
||||
|
||||
add_test(function test_StructuredLogCommands() {
|
||||
let appender = new MockAppender(new Log4Moz.StructuredFormatter());
|
||||
let logger = Log4Moz.repository.getLogger("test.StructuredOutput");
|
||||
let appender = new MockAppender(new Log.StructuredFormatter());
|
||||
let logger = Log.repository.getLogger("test.StructuredOutput");
|
||||
logger.addAppender(appender);
|
||||
logger.level = Log4Moz.Level.Info;
|
||||
logger.level = Log.Level.Info;
|
||||
|
||||
logger.logStructured("test_message", {_message: "message string one"});
|
||||
logger.logStructured("test_message", {_message: "message string two",
|
||||
_level: "ERROR",
|
||||
source_file: "test_log4moz.js"});
|
||||
source_file: "test_Log.js"});
|
||||
logger.logStructured("test_message");
|
||||
logger.logStructured("test_message", {source_file: "test_log4moz.js",
|
||||
logger.logStructured("test_message", {source_file: "test_Log.js",
|
||||
message_position: 4});
|
||||
|
||||
let messageOne = {"_time": /\d+/,
|
||||
@ -120,7 +122,7 @@ add_test(function test_StructuredLogCommands() {
|
||||
"_level": "ERROR",
|
||||
"_message": "message string two",
|
||||
"action": "test_message",
|
||||
"source_file": "test_log4moz.js"};
|
||||
"source_file": "test_Log.js"};
|
||||
|
||||
let messageThree = {"_time": /\d+/,
|
||||
"_namespace": "test.StructuredOutput",
|
||||
@ -131,7 +133,7 @@ add_test(function test_StructuredLogCommands() {
|
||||
"_namespace": "test.StructuredOutput",
|
||||
"_level": "INFO",
|
||||
"action": "test_message",
|
||||
"source_file": "test_log4moz.js",
|
||||
"source_file": "test_Log.js",
|
||||
"message_position": 4};
|
||||
|
||||
checkObjects(messageOne, JSON.parse(appender.messages[0]));
|
||||
@ -161,15 +163,15 @@ add_test(function test_StructuredLogCommands() {
|
||||
|
||||
// Logging with unstructured interface should produce the same messages
|
||||
// as the structured interface for these cases.
|
||||
let appender = new MockAppender(new Log4Moz.StructuredFormatter());
|
||||
let logger = Log4Moz.repository.getLogger("test.StructuredOutput1");
|
||||
let appender = new MockAppender(new Log.StructuredFormatter());
|
||||
let logger = Log.repository.getLogger("test.StructuredOutput1");
|
||||
messageOne._namespace = "test.StructuredOutput1";
|
||||
messageTwo._namespace = "test.StructuredOutput1";
|
||||
logger.addAppender(appender);
|
||||
logger.level = Log4Moz.Level.All;
|
||||
logger.level = Log.Level.All;
|
||||
logger.info("message string one", {action: "test_message"});
|
||||
logger.error("message string two", {action: "test_message",
|
||||
source_file: "test_log4moz.js"});
|
||||
source_file: "test_Log.js"});
|
||||
|
||||
checkObjects(messageOne, JSON.parse(appender.messages[0]));
|
||||
checkObjects(messageTwo, JSON.parse(appender.messages[1]));
|
||||
@ -178,12 +180,12 @@ add_test(function test_StructuredLogCommands() {
|
||||
});
|
||||
|
||||
add_test(function test_StorageStreamAppender() {
|
||||
let appender = new Log4Moz.StorageStreamAppender(testFormatter);
|
||||
let appender = new Log.StorageStreamAppender(testFormatter);
|
||||
do_check_eq(appender.getInputStream(), null);
|
||||
|
||||
// Log to the storage stream and verify the log was written and can be
|
||||
// read back.
|
||||
let logger = Log4Moz.repository.getLogger("test.StorageStreamAppender");
|
||||
let logger = Log.repository.getLogger("test.StorageStreamAppender");
|
||||
logger.addAppender(appender);
|
||||
logger.info("OHAI");
|
||||
let inputStream = appender.getInputStream();
|
||||
@ -218,11 +220,11 @@ function fileContents(path) {
|
||||
|
||||
add_task(function test_FileAppender() {
|
||||
// This directory does not exist yet
|
||||
let dir = OS.Path.join(do_get_profile().path, "test_log4moz");
|
||||
let dir = OS.Path.join(do_get_profile().path, "test_Log");
|
||||
do_check_false(yield OS.File.exists(dir));
|
||||
let path = OS.Path.join(dir, "test_FileAppender");
|
||||
let appender = new Log4Moz.FileAppender(path, testFormatter);
|
||||
let logger = Log4Moz.repository.getLogger("test.FileAppender");
|
||||
let appender = new Log.FileAppender(path, testFormatter);
|
||||
let logger = Log.repository.getLogger("test.FileAppender");
|
||||
logger.addAppender(appender);
|
||||
|
||||
// Logging to a file that can't be created won't do harm.
|
||||
@ -271,11 +273,11 @@ add_task(function test_FileAppender() {
|
||||
});
|
||||
|
||||
add_task(function test_BoundedFileAppender() {
|
||||
let dir = OS.Path.join(do_get_profile().path, "test_log4moz");
|
||||
let dir = OS.Path.join(do_get_profile().path, "test_Log");
|
||||
let path = OS.Path.join(dir, "test_BoundedFileAppender");
|
||||
// This appender will hold about two lines at a time.
|
||||
let appender = new Log4Moz.BoundedFileAppender(path, testFormatter, 40);
|
||||
let logger = Log4Moz.repository.getLogger("test.BoundedFileAppender");
|
||||
let appender = new Log.BoundedFileAppender(path, testFormatter, 40);
|
||||
let logger = Log.repository.getLogger("test.BoundedFileAppender");
|
||||
logger.addAppender(appender);
|
||||
|
||||
logger.info("ONE");
|
@ -10,6 +10,7 @@ support-files =
|
||||
[test_dict.js]
|
||||
[test_FileUtils.js]
|
||||
[test_Http.js]
|
||||
[test_Log.js]
|
||||
[test_PermissionsUtils.js]
|
||||
[test_Preferences.js]
|
||||
[test_Promise.js]
|
||||
|
Loading…
Reference in New Issue
Block a user