Skip to content

Commit 57f05c6

Browse files
authored
Merge pull request #226 from kmiller68/console-warn-and-error-stderr-clis
Shells should send console.warn and error to stderr
2 parents 7acc790 + 2533fe5 commit 57f05c6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

utils/shell-config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018 Apple Inc. All rights reserved.
2+
* Copyright (C) 2018-2025 Apple Inc. All rights reserved.
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions
@@ -27,10 +27,10 @@ const isInBrowser = false;
2727
if (typeof console == "undefined")
2828
console = {};
2929

30-
console.debug ??= (...args) => console.log("Debug:", ...args);
30+
console.debug ??= (...args) => printErr("Debug: " + args.join(" "));
3131
console.log ??= (...args) => print(args.join(" "));
32-
console.warn ??= (...args) => console.log("Warn:", ...args);
33-
console.error ??= (...args) => console.log("Error:", ...args);
32+
console.warn ??= (...args) => printErr("Warn: " + args.join(" "));
33+
console.error ??= (...args) => printErr("Error: " + args.join(" "));
3434
console.assert ??= (condition, message) => {
3535
if (!condition)
3636
throw new Error(`Assertion failed: ${message}`);

0 commit comments

Comments
 (0)