Skip to content

Commit a413ccd

Browse files
logging: only log to console in browser #3808
Problem: Logging to the console causes duplicate messages in e.g. CI test logs. Solution: Only log to the console in the Browser, not Node.js Signed-off-by: nkomonen <[email protected]>
1 parent 1b29da8 commit a413ccd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/shared/logger/activation.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export async function activate(
4343
{
4444
logPaths: [logUri.fsPath],
4545
outputChannels: [chan],
46-
useConsoleLog: true,
46+
useConsoleLog: isInBrowser(),
4747
},
4848
extensionContext.subscriptions
4949
)
@@ -100,7 +100,8 @@ export async function activate(
100100
* @param opts.staticLogLevel Static log level, overriding config value. Will persist overridden config value even if the config value changes.
101101
* @param opts.logPaths Array of paths to output log entries to
102102
* @param opts.outputChannels Array of output channels to log entries to
103-
* @param opts.useDebugConsole If true, outputs log entries to currently-active debug console. As per VS Code API, cannot specify a debug console in particular.
103+
* @param opts.useDebugConsole If true, outputs log entries to `vscode.debug.activeDebugConsole`
104+
* @param opts.useConsoleLog If true, outputs log entries to the nodejs or browser devtools console.
104105
* @param disposables Array of disposables to add a subscription to
105106
*/
106107
export function makeLogger(

0 commit comments

Comments
 (0)