From a493f7e81ee7653f4e7aa93662a39e77b7045c6e Mon Sep 17 00:00:00 2001 From: Keith Miller Date: Thu, 23 Oct 2025 15:50:13 -0400 Subject: [PATCH 1/2] Shells should send console.warn and error to stderr Right now they go to stdout, which makes running with json-dumping less effective since we `warn` the subset of tests being run. --- utils/shell-config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/shell-config.js b/utils/shell-config.js index 8b2c6da9..49c8ec48 100644 --- a/utils/shell-config.js +++ b/utils/shell-config.js @@ -29,8 +29,8 @@ if (typeof console == "undefined") console.debug ??= (...args) => console.log("Debug:", ...args); console.log ??= (...args) => print(args.join(" ")); -console.warn ??= (...args) => console.log("Warn:", ...args); -console.error ??= (...args) => console.log("Error:", ...args); +console.warn ??= (...args) => printErr("Warn: " + args.join(" ")); +console.error ??= (...args) => printErr("Error: " + args.join(" ")); console.assert ??= (condition, message) => { if (!condition) throw new Error(`Assertion failed: ${message}`); From 2533fe509c25b668f205912083eb17e0a24d06a2 Mon Sep 17 00:00:00 2001 From: Keith Miller Date: Thu, 30 Oct 2025 10:53:38 +0100 Subject: [PATCH 2/2] Add console.debug to the list --- utils/shell-config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/shell-config.js b/utils/shell-config.js index 49c8ec48..59d7895c 100644 --- a/utils/shell-config.js +++ b/utils/shell-config.js @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018 Apple Inc. All rights reserved. + * Copyright (C) 2018-2025 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -27,7 +27,7 @@ const isInBrowser = false; if (typeof console == "undefined") console = {}; -console.debug ??= (...args) => console.log("Debug:", ...args); +console.debug ??= (...args) => printErr("Debug: " + args.join(" ")); console.log ??= (...args) => print(args.join(" ")); console.warn ??= (...args) => printErr("Warn: " + args.join(" ")); console.error ??= (...args) => printErr("Error: " + args.join(" "));