2024-01-01 14:58:21 -05:00
|
|
|
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
2023-02-14 11:38:45 -05:00
|
|
|
|
2024-09-11 03:55:58 -04:00
|
|
|
import { primordials } from "ext:core/mod.js";
|
2023-03-08 06:44:54 -05:00
|
|
|
import { Console } from "ext:deno_node/internal/console/constructor.mjs";
|
2024-01-06 08:40:26 -05:00
|
|
|
import { windowOrWorkerGlobalScope } from "ext:runtime/98_global_scope_shared.js";
|
2023-02-15 13:44:52 -05:00
|
|
|
// Don't rely on global `console` because during bootstrapping, it is pointing
|
|
|
|
// to native `console` object provided by V8.
|
|
|
|
const console = windowOrWorkerGlobalScope.console.value;
|
2023-02-14 11:38:45 -05:00
|
|
|
|
2024-09-11 03:55:58 -04:00
|
|
|
const { ObjectAssign } = primordials;
|
|
|
|
|
|
|
|
ObjectAssign(console, { Console });
|
2024-08-28 15:13:34 -04:00
|
|
|
|
|
|
|
export default console;
|
2023-02-14 11:38:45 -05:00
|
|
|
|
|
|
|
export { Console };
|
|
|
|
export const {
|
|
|
|
assert,
|
|
|
|
clear,
|
|
|
|
count,
|
|
|
|
countReset,
|
|
|
|
debug,
|
|
|
|
dir,
|
|
|
|
dirxml,
|
|
|
|
error,
|
|
|
|
group,
|
|
|
|
groupCollapsed,
|
|
|
|
groupEnd,
|
|
|
|
info,
|
|
|
|
log,
|
|
|
|
profile,
|
|
|
|
profileEnd,
|
|
|
|
table,
|
|
|
|
time,
|
|
|
|
timeEnd,
|
|
|
|
timeLog,
|
|
|
|
timeStamp,
|
|
|
|
trace,
|
|
|
|
warn,
|
|
|
|
} = console;
|
|
|
|
// deno-lint-ignore no-explicit-any
|
|
|
|
export const indentLevel = (console as any)?.indentLevel;
|