diff options
author | Luca Casonato <lucacasonato@yahoo.com> | 2021-03-18 19:25:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-18 19:25:25 +0100 |
commit | 62716422b9f57b11f3a0afb01f5011b63702226d (patch) | |
tree | 4f086a4a644c97488e3319028509fe5293496505 /runtime/js | |
parent | 20627c91364d2a992fdfaaad7c8ae86454dbc2ed (diff) |
chore(console): distinguish between log levels (#9824)
Change `Console.#printFunc` to pass a log level as the second argument
(0 = debug, 3 = error), instead of a boolean for `isErr`. This does not
change the Deno runtime behaviour at all.
Diffstat (limited to 'runtime/js')
-rw-r--r-- | runtime/js/99_main.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 233c5cd43..a2fff2571 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -290,7 +290,9 @@ delete Object.prototype.__proto__; btoa: util.writable(btoa), clearInterval: util.writable(timers.clearInterval), clearTimeout: util.writable(timers.clearTimeout), - console: util.writable(new Console(core.print)), + console: util.writable( + new Console((msg, level) => core.print(msg, level > 1)), + ), crypto: util.readOnly(crypto), fetch: util.writable(fetch.fetch), performance: util.writable(performance.performance), |