From 3e0e8475a621bcb3e1074af9dc8f0be585a33378 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 29 Jun 2021 07:46:48 +0200 Subject: [PATCH] [CHG] config: flip debug mode warning to info Backport of odoo/odoo@e4834fce692b7eb6fe6cfc66a8e5daed814c0230 There's no way to easily disable / silence this warning, because multiple tours explicitly opt into debug mode (with good reasons). So it's not enough to bypass the `mode` setter in the test setup helpers and set `QWeb.dev` directly (which works for test_main in POS and main_tests in web), there would also need to be special workarounds in the 4 modules which set `owl.config.mode` based on the session's debug mode. I'm not sure how useful this warning is: it defaults to `false` so the only situation in which this would be relevant would be for a third-party to use Owl *and* explicitly enable the debug mode in-source *and* forget to remove it when deploying to production *and* look at their console. --- src/config.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/config.ts b/src/config.ts index eedd0e56..5edc1c41 100644 --- a/src/config.ts +++ b/src/config.ts @@ -20,10 +20,10 @@ Object.defineProperty(config, "mode", { set(mode: string) { QWeb.dev = mode === "dev"; if (QWeb.dev) { - const url = `https://github.com/odoo/owl/blob/master/doc/reference/config.md#mode`; - console.warn( - `Owl is running in 'dev' mode. This is not suitable for production use. See ${url} for more information.` - ); + console.info(`Owl is running in 'dev' mode. + +This is not suitable for production use. +See https://github.com/odoo/owl/blob/master/doc/reference/config.md#mode for more information.`); } else { console.log(`Owl is now running in 'prod' mode.`); }