diff --git a/package-lock.json b/package-lock.json index 7fea1de00..ca6760d50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2737,15 +2737,6 @@ } } }, - "vscode-debug-logger": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/vscode-debug-logger/-/vscode-debug-logger-0.0.5.tgz", - "integrity": "sha512-2ind8s4U8h1Mkgm+Spo7Y15Poz/MrlY0xasIYQSK4kr7kTG6pNiyRrQ782dDIOZeivlj14uiyRarg8j9kYs/tQ==", - "requires": { - "vscode-debugadapter": "1.32.1", - "vscode-debugprotocol": "1.32.0" - } - }, "vscode-debugadapter": { "version": "1.32.1", "resolved": "https://registry.npmjs.org/vscode-debugadapter/-/vscode-debugadapter-1.32.1.tgz", diff --git a/package.json b/package.json index 71bf3746d..3b4651b54 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,6 @@ "console-stamp": "^0.2.7", "diff": "^3.5.0", "json-rpc2": "^1.0.2", - "vscode-debug-logger": "0.0.5", "vscode-debugadapter": "^1.32.1", "vscode-debugprotocol": "^1.32.0", "vscode-extension-telemetry": "^0.1.0", diff --git a/src/debugAdapter/goDebug.ts b/src/debugAdapter/goDebug.ts index 3369c03b5..8f67fc8d4 100644 --- a/src/debugAdapter/goDebug.ts +++ b/src/debugAdapter/goDebug.ts @@ -6,13 +6,12 @@ import * as path from 'path'; import * as os from 'os'; import { DebugProtocol } from 'vscode-debugprotocol'; -import { DebugSession, InitializedEvent, TerminatedEvent, ThreadEvent, StoppedEvent, OutputEvent, Thread, StackFrame, Scope, Source, Handles } from 'vscode-debugadapter'; +import { DebugSession, InitializedEvent, TerminatedEvent, ThreadEvent, StoppedEvent, OutputEvent, Thread, StackFrame, Scope, Source, Handles, LoggingDebugSession, Logger, logger } from 'vscode-debugadapter'; import { existsSync, lstatSync } from 'fs'; import { basename, dirname, extname } from 'path'; import { spawn, ChildProcess, execSync, spawnSync, execFile } from 'child_process'; import { Client, RPCConnection } from 'json-rpc2'; import { parseEnvFile, getBinPathWithPreferredGopath, resolveHomeDir, getInferredGopath, getCurrentGoWorkspaceFromGOPATH, envPath, fixDriveCasingInWindows } from '../goPath'; -import * as logger from 'vscode-debug-logger'; require('console-stamp')(console); @@ -516,7 +515,7 @@ class Delve { } } -class GoDebugSession extends DebugSession { +class GoDebugSession extends LoggingDebugSession { private _variableHandles: Handles; private breakpoints: Map; @@ -531,15 +530,12 @@ class GoDebugSession extends DebugSession { private readonly initdone = 'initdoneĀ·'; public constructor(debuggerLinesStartAt1: boolean, isServer: boolean = false) { - super(debuggerLinesStartAt1, isServer); + super('', debuggerLinesStartAt1, isServer); this._variableHandles = new Handles(); this.threads = new Set(); this.debugState = null; this.delve = null; this.breakpoints = new Map(); - - const logPath = path.join(os.tmpdir(), 'vscode-go-debug.txt'); - logger.init(e => this.sendEvent(e), logPath, isServer); } protected initializeRequest(response: DebugProtocol.InitializeResponse, args: DebugProtocol.InitializeRequestArguments): void { @@ -558,10 +554,10 @@ class GoDebugSession extends DebugSession { protected launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void { this.launchArgs = args; const logLevel = args.trace === 'verbose' ? - logger.LogLevel.Verbose : - args.trace ? logger.LogLevel.Log : - logger.LogLevel.Error; - logger.setMinLogLevel(logLevel); + Logger.LogLevel.Verbose : + args.trace ? Logger.LogLevel.Log : + Logger.LogLevel.Error; + logger.setup(logLevel); if (!args.program) { this.sendErrorResponse(response, 3000, 'Failed to continue: The program attribute is missing in the debug configuration in launch.json');