зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1251057 - enable debug logging for rest.js requests and responses. r=adw
This commit is contained in:
Родитель
1d48126258
Коммит
306ad15e8f
|
@ -196,12 +196,6 @@ LogManager.prototype = {
|
|||
// now attach the appenders to all our logs.
|
||||
for (let logName of logNames) {
|
||||
let log = Log.repository.getLogger(logName);
|
||||
// Set all of the logs themselves to log all messages, and rely on the
|
||||
// more restrictive levels on the appenders to restrict what is seen.
|
||||
// (We possibly could find the smallest appender level and set the logs
|
||||
// to that, but that gets tricky when we consider a singe log might end
|
||||
// up being managed by multiple log managers - so this is fine for now.)
|
||||
log.level = Log.Level.All;
|
||||
for (let appender of [fapp, dumpAppender, consoleAppender]) {
|
||||
log.addAppender(appender);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ Cu.import("resource://services-common/utils.js");
|
|||
XPCOMUtils.defineLazyModuleGetter(this, "CryptoUtils",
|
||||
"resource://services-crypto/utils.js");
|
||||
|
||||
const Prefs = new Preferences("services.common.rest.");
|
||||
const Prefs = new Preferences("services.common.");
|
||||
|
||||
/**
|
||||
* Single use HTTP requests to RESTish resources.
|
||||
|
@ -316,6 +316,7 @@ RESTRequest.prototype = {
|
|||
channel.loadFlags |= this.loadFlags;
|
||||
channel.notificationCallbacks = this;
|
||||
|
||||
this._log.debug(`${method} request to ${this.uri.spec}`);
|
||||
// Set request headers.
|
||||
let headers = this._headers;
|
||||
for (let key in headers) {
|
||||
|
@ -642,7 +643,7 @@ this.RESTResponse = function RESTResponse() {
|
|||
}
|
||||
RESTResponse.prototype = {
|
||||
|
||||
_logName: "Sync.RESTResponse",
|
||||
_logName: "Services.Common.RESTResponse",
|
||||
|
||||
/**
|
||||
* Corresponding REST request
|
||||
|
|
|
@ -561,7 +561,9 @@ ErrorHandler.prototype = {
|
|||
root.level = Log.Level[Svc.Prefs.get("log.rootLogger")];
|
||||
|
||||
let logs = ["Sync", "FirefoxAccounts", "Hawk", "Common.TokenServerClient",
|
||||
"Sync.SyncMigration", "browserwindow.syncui"];
|
||||
"Sync.SyncMigration", "browserwindow.syncui",
|
||||
"Services.Common.RESTRequest", "Services.Common.RESTRequest",
|
||||
];
|
||||
|
||||
this._logManager = new LogManager(Svc.Prefs, logs, "sync");
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче