summaryrefslogtreecommitdiff
path: root/cli/rt/02_console.js
diff options
context:
space:
mode:
Diffstat (limited to 'cli/rt/02_console.js')
-rw-r--r--cli/rt/02_console.js19
1 files changed, 8 insertions, 11 deletions
diff --git a/cli/rt/02_console.js b/cli/rt/02_console.js
index bb2b6ea41..0eb7f0aac 100644
--- a/cli/rt/02_console.js
+++ b/cli/rt/02_console.js
@@ -1425,12 +1425,10 @@
const timerMap = new Map();
const isConsoleInstance = Symbol("isConsoleInstance");
- function getConsoleInspectOptions() {
- return {
- ...DEFAULT_INSPECT_OPTIONS,
- colors: !(globalThis.Deno?.noColor ?? false),
- };
- }
+ const CONSOLE_INSPECT_OPTIONS = {
+ ...DEFAULT_INSPECT_OPTIONS,
+ colors: true,
+ };
class Console {
#printFunc = null;
@@ -1453,7 +1451,7 @@
log = (...args) => {
this.#printFunc(
inspectArgs(args, {
- ...getConsoleInspectOptions(),
+ ...CONSOLE_INSPECT_OPTIONS,
indentLevel: this.indentLevel,
}) + "\n",
false,
@@ -1465,8 +1463,7 @@
dir = (obj, options = {}) => {
this.#printFunc(
- inspectArgs([obj], { ...getConsoleInspectOptions(), ...options }) +
- "\n",
+ inspectArgs([obj], { ...CONSOLE_INSPECT_OPTIONS, ...options }) + "\n",
false,
);
};
@@ -1476,7 +1473,7 @@
warn = (...args) => {
this.#printFunc(
inspectArgs(args, {
- ...getConsoleInspectOptions(),
+ ...CONSOLE_INSPECT_OPTIONS,
indentLevel: this.indentLevel,
}) + "\n",
true,
@@ -1682,7 +1679,7 @@
trace = (...args) => {
const message = inspectArgs(
args,
- { ...getConsoleInspectOptions(), indentLevel: 0 },
+ { ...CONSOLE_INSPECT_OPTIONS, indentLevel: 0 },
);
const err = {
name: "Trace",