Bug 1911382 - [remote] Reduce logs for MessageHandler module system r=webdriver-reviewers,whimboo

Removing those 2 logs by default reduces the log size of the pup wd job significantly (320K lines -> 200K lines)

Differential Revision: https://phabricator.services.mozilla.com/D218777
This commit is contained in:
Julian Descottes 2024-08-09 15:00:30 +00:00
Родитель 482161db62
Коммит bcf38234f8
2 изменённых файлов: 27 добавлений и 8 удалений

Просмотреть файл

@ -62,6 +62,17 @@ export class Log {
return StdLog.Level[lazy.logLevel] <= StdLog.Level.Trace;
}
/**
* WARNING: This helper is incorrectly implemented and probably doesn't do
* what you would expect.
*
* At the moment `verbose` will be true for the least verbose log levels:
* INFO, WARN, ERROR and FATAL. Fixing the issue would lead to too much
* additional log spam on CI so we will need to use another approach, and
* probably to decouple it from the log level.
*
* See https://bugzilla.mozilla.org/show_bug.cgi?id=1828395
*/
static get verbose() {
// we can't use Preferences.sys.mjs before first paint,
// see ../browser/base/content/test/performance/browser_startup.js

Просмотреть файл

@ -233,14 +233,22 @@ export class ModuleCache {
moduleClass = this.#protocol.modules[moduleFolder][moduleName];
}
if (moduleClass) {
lazy.logger.trace(
`Module ${moduleFolder}/${moduleName}.sys.mjs found for ${destinationType}`
);
} else {
lazy.logger.trace(
`Module ${moduleFolder}/${moduleName}.sys.mjs not found for ${destinationType}`
);
// Module hit/miss logs generate a lot of spam. Only log if verbose is true.
//
// Note: Due to https://bugzilla.mozilla.org/show_bug.cgi?id=1828395
// verbose is currently always false if the log level is trace.
// If those logs are needed before the bug is fixed, temporarily remove the
// condition.
if (lazy.Log.verbose) {
if (moduleClass) {
lazy.logger.trace(
`Module ${moduleFolder}/${moduleName}.sys.mjs found for ${destinationType}`
);
} else {
lazy.logger.trace(
`Module ${moduleFolder}/${moduleName}.sys.mjs not found for ${destinationType}`
);
}
}
return moduleClass;