Skip to content

Commit 69c141f

Browse files
bmeurerDevtools-frontend LUCI CQ
authored andcommitted
[visual_logging] Only emit 'unknown VE context' errors for debug builds.
These error messages are not actionable for extension developers, but only for DevTools engineers themselves, and there's no point to bother externals with these messages. Fixed: 369319572 Bug: 357571602 Change-Id: I4a36b1e7ec0afe4e6079af5ab4a90f01659f6277 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5987812 Auto-Submit: Benedikt Meurer <[email protected]> Commit-Queue: Benedikt Meurer <[email protected]> Reviewed-by: Danil Somsikov <[email protected]> Commit-Queue: Danil Somsikov <[email protected]>
1 parent 90e9829 commit 69c141f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

front_end/ui/visual_logging/BUILD.gn

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ devtools_module("visual_logging") {
2121
deps = [
2222
"../../core/common:bundle",
2323
"../../core/host:bundle",
24+
"../../core/root:bundle",
2425
"../components/render_coordinator:bundle",
2526
]
2627
}

front_end/ui/visual_logging/LoggingConfig.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
import * as Root from '../../core/root/root.js';
6+
57
import {knownContextValues} from './KnownContextValues.js';
68

79
const LOGGING_ATTRIBUTE = 'jslog';
@@ -124,8 +126,10 @@ function checkContextValue(context: string|number|undefined): void {
124126
reportedUnknownVeContext.has(context)) {
125127
return;
126128
}
127-
const stack = (new Error().stack || '').split('\n').slice(3).join('\n');
128-
console.error(`Unknown VE context: ${context}${stack}`);
129+
if (Root.Runtime.Runtime.queryParam('debugFrontend')) {
130+
const stack = (new Error().stack || '').split('\n').slice(3).join('\n');
131+
console.error(`Unknown VE context: ${context}${stack}`);
132+
}
129133
reportedUnknownVeContext.add(context);
130134
}
131135

0 commit comments

Comments
 (0)