From 62716422b9f57b11f3a0afb01f5011b63702226d Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 18 Mar 2021 19:25:25 +0100 Subject: 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. --- cli/tests/unit/console_test.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cli/tests') diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts index 286b693ff..402f448bc 100644 --- a/cli/tests/unit/console_test.ts +++ b/cli/tests/unit/console_test.ts @@ -316,12 +316,12 @@ unitTest(function consoleTestStringifyCircular(): void { stringify(console), `console { log: [Function: log], - debug: [Function: log], - info: [Function: log], + debug: [Function: debug], + info: [Function: info], dir: [Function: dir], dirxml: [Function: dir], warn: [Function: warn], - error: [Function: warn], + error: [Function: error], assert: [Function: assert], count: [Function: count], countReset: [Function: countReset], @@ -1191,9 +1191,9 @@ function mockConsole(f: ConsoleExamineFunc): void { const err = new StringBuffer(); const both = new StringBuffer(); const csl = new Console( - (x: string, isErr: boolean, printsNewLine: boolean): void => { + (x: string, level: number, printsNewLine: boolean): void => { const content = x + (printsNewLine ? "\n" : ""); - const buf = isErr ? err : out; + const buf = level > 1 ? err : out; buf.add(content); both.add(content); }, -- cgit v1.2.3