diff --git a/remote/shared/Log.sys.mjs b/remote/shared/Log.sys.mjs index f1b3706391ec..e7e38edef308 100644 --- a/remote/shared/Log.sys.mjs +++ b/remote/shared/Log.sys.mjs @@ -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 diff --git a/remote/shared/messagehandler/ModuleCache.sys.mjs b/remote/shared/messagehandler/ModuleCache.sys.mjs index 6cff8dff60f0..7383ecde01db 100644 --- a/remote/shared/messagehandler/ModuleCache.sys.mjs +++ b/remote/shared/messagehandler/ModuleCache.sys.mjs @@ -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;