diff --git a/package.json b/package.json index 2fc61a45d96..c80caa31f89 100644 --- a/package.json +++ b/package.json @@ -1411,7 +1411,8 @@ "error", "warn", "info", - "debug" + "debug", + "verbose" ], "description": "The logging level the extension logs at.", "scope": "machine" diff --git a/src/client/common/configSettings.ts b/src/client/common/configSettings.ts index 397c76e0af2..1e366969eb2 100644 --- a/src/client/common/configSettings.ts +++ b/src/client/common/configSettings.ts @@ -273,6 +273,9 @@ function convertSettingTypeToLogLevel(setting: LoggingLevelSettingType | undefin case 'debug': { return LogLevel.Debug; } + case 'verbose': { + return LogLevel.Trace; + } default: { return LogLevel.Error; } diff --git a/src/client/common/types.ts b/src/client/common/types.ts index 610587e62e3..3e48cc82b9a 100644 --- a/src/client/common/types.ts +++ b/src/client/common/types.ts @@ -186,7 +186,7 @@ export interface IWatchableJupyterSettings extends IJupyterSettings { readonly onDidChange: Event; } -export type LoggingLevelSettingType = 'off' | 'error' | 'warn' | 'info' | 'debug'; +export type LoggingLevelSettingType = 'off' | 'error' | 'warn' | 'info' | 'debug' | 'verbose'; export interface ILoggingSettings { readonly level: LogLevel | 'off'; diff --git a/src/client/debugger/jupyter/kernelDebugAdapter.ts b/src/client/debugger/jupyter/kernelDebugAdapter.ts index 08b9e827b22..9946f1a65ee 100644 --- a/src/client/debugger/jupyter/kernelDebugAdapter.ts +++ b/src/client/debugger/jupyter/kernelDebugAdapter.ts @@ -25,7 +25,7 @@ import * as path from 'path'; import { IJupyterSession } from '../../datascience/types'; import { KernelMessage } from '@jupyterlab/services'; import { ICommandManager } from '../../common/application/types'; -import { traceError } from '../../common/logger'; +import { traceError, traceVerbose } from '../../common/logger'; import { IFileSystem } from '../../common/platform/types'; import { IKernelDebugAdapter } from '../types'; import { IDisposable } from '../../common/types'; @@ -202,6 +202,12 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID this, this.disposables ); + + this.disposables.push(this.onDidSendMessage((msg) => this.trace('to client', JSON.stringify(msg)))); + } + + private trace(tag: string, msg: string) { + traceVerbose(`[Debug] ${tag}: ${msg}`); } async handleMessage(message: DebugProtocol.ProtocolMessage) { @@ -342,6 +348,7 @@ export class KernelDebugAdapter implements DebugAdapter, IKernelDebugAdapter, ID } }); + this.trace('to kernel', JSON.stringify(message)); if (message.type === 'request') { this.sendMessage.fire(message); const request = debugRequest(message as DebugProtocol.Request, this.jupyterSession.sessionId); diff --git a/src/client/extensionActivation.ts b/src/client/extensionActivation.ts index afa136ae403..46855ba02eb 100644 --- a/src/client/extensionActivation.ts +++ b/src/client/extensionActivation.ts @@ -112,7 +112,11 @@ async function activateLegacy( // We should start logging using the log level as soon as possible, so set it as soon as we can access the level. // `IConfigurationService` may depend any of the registered types, so doing it after all registrations are finished. // XXX Move this *after* abExperiments is activated? - setLoggingLevel(configuration.getSettings().logging.level); + const settings = configuration.getSettings(); + setLoggingLevel(settings.logging.level); + settings.onDidChange(() => { + setLoggingLevel(settings.logging.level); + }); // Register datascience types after experiments have loaded. // To ensure we can register types based on experiments. diff --git a/src/client/logging/_global.ts b/src/client/logging/_global.ts index ddcb81b9615..35aaf5e90f6 100644 --- a/src/client/logging/_global.ts +++ b/src/client/logging/_global.ts @@ -80,7 +80,7 @@ export function log(logLevel: LogLevel, ...args: Arguments) { // eslint-disable-next-line @typescript-eslint/no-explicit-any export function logVerbose(...args: any[]) { - log(LogLevel.Info, ...args); + log(LogLevel.Trace, ...args); } // eslint-disable-next-line @typescript-eslint/no-explicit-any