Skip to content

Generated lox_wasm is sending out console log messages and is ".jsm"

As mentioned in !970 (comment 3016173) the lox_wasm.jsm contains a few console.log messages that are causing some noise in the "Browser Toolbox". Moreover, the generated file is a ".jsm" rather than ".sys.mjs".

For the console part, the module can use its own console instance so it can be filtered out:

logger = console.createInstance({
  maxLogLevel: "warn",
  maxLogLevelPref: "lox.log_level",
  prefix: "Lox",
});

/* ... */

logger.log(...);

logger.warn(...);

Note I reused the "lox.log_level" preference we use for the Lox.sys.mjs module, but it would be ok to use a new preference. Also, you can use a lazy getter with ChromeUtils.defineLazyGetter if desired.

/cc @cohosh @pierov

Edited by henry
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information