Skip to content

Commit 606c335

Browse files
committed
Some more cleanup
1 parent 913edeb commit 606c335

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

lldb/tools/lldb-dap/src-ts/debug-adapter-factory.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,7 @@ export class LLDBDapDescriptorFactory
231231
executable: vscode.DebugAdapterExecutable | undefined,
232232
): Promise<vscode.DebugAdapterDescriptor | undefined> {
233233
this.logger.info(`Creating debug adapter for session "${session.name}"`);
234-
this.logger.debug(`Session "${session.name}" debug configuration:`);
235-
this.logger.debug(JSON.stringify(session.configuration, undefined, 2));
234+
this.logger.debug(`Session "${session.name}" debug configuration:\n` + JSON.stringify(session.configuration, undefined, 2));
236235
if (executable) {
237236
const error = new Error(
238237
"Setting the debug adapter executable in the package.json is not supported.",

lldb/tools/lldb-dap/src-ts/debug-configuration-provider.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ export class LLDBDapConfigurationProvider
8080
token?: vscode.CancellationToken,
8181
): Promise<vscode.DebugConfiguration> {
8282
this.logger.info(`Resolving debug configuration for "${debugConfiguration.name}"`);
83-
this.logger.debug("Initial debug configuration:");
84-
this.logger.debug(JSON.stringify(debugConfiguration, undefined, 2));
83+
this.logger.debug("Initial debug configuration:\n" + JSON.stringify(debugConfiguration, undefined, 2));
8584
let config = vscode.workspace.getConfiguration("lldb-dap");
8685
for (const [key, cfg] of Object.entries(configurations)) {
8786
if (Reflect.has(debugConfiguration, key)) {
@@ -189,8 +188,7 @@ export class LLDBDapConfigurationProvider
189188
}
190189
}
191190

192-
this.logger.debug("Resolved debug configuration:");
193-
this.logger.debug(JSON.stringify(debugConfiguration, undefined, 2));
191+
this.logger.debug("Resolved debug configuration:\n" + JSON.stringify(debugConfiguration, undefined, 2));
194192

195193
return debugConfiguration;
196194
} catch (error) {

lldb/tools/lldb-dap/src-ts/logger.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,12 @@ export class Logger implements vscode.Disposable {
7171
private normalizeMessage(message: any) {
7272
if (typeof message === "string") {
7373
return message;
74-
} else if (typeof message === "object") {
74+
}
75+
try {
7576
return JSON.stringify(message);
77+
} catch (e) {
78+
return `${message}`;
7679
}
77-
return `${message}`;
7880
}
7981

8082
private outputChannelLevel(): string {

0 commit comments

Comments
 (0)