From 712b6d48acf95cbf39d06d64c257c80409132c4a Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Mon, 12 Nov 2018 15:53:04 -0800 Subject: [PATCH 1/2] Pass in null for TraceFlag StartDate --- .../src/commands/forceStartApexDebugLogging.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/salesforcedx-vscode-core/src/commands/forceStartApexDebugLogging.ts b/packages/salesforcedx-vscode-core/src/commands/forceStartApexDebugLogging.ts index 1f83124aca..30a06a864c 100644 --- a/packages/salesforcedx-vscode-core/src/commands/forceStartApexDebugLogging.ts +++ b/packages/salesforcedx-vscode-core/src/commands/forceStartApexDebugLogging.ts @@ -176,9 +176,7 @@ export class CreateTraceFlag extends SfdxCommandletExecutor<{}> { .withFlag( '--values', `tracedentityid='${this - .userId}' logtype=developer_log debuglevelid=${developerLogTraceFlag.getDebugLevelId()} StartDate='${developerLogTraceFlag - .getStartDate() - .toUTCString()}' ExpirationDate='${developerLogTraceFlag + .userId}' logtype=developer_log debuglevelid=${developerLogTraceFlag.getDebugLevelId()} StartDate='' ExpirationDate='${developerLogTraceFlag .getExpirationDate() .toUTCString()}` ) @@ -216,9 +214,7 @@ export class UpdateTraceFlagsExecutor extends SfdxCommandletExecutor<{}> { .withFlag('--sobjectid', nonNullTraceFlag) .withFlag( '--values', - `StartDate='${developerLogTraceFlag - .getStartDate() - .toUTCString()}' ExpirationDate='${developerLogTraceFlag + `StartDate='' ExpirationDate='${developerLogTraceFlag .getExpirationDate() .toUTCString()}'` ) From e5d97bcad1000feed8d8890478a3fb5f74abf8a1 Mon Sep 17 00:00:00 2001 From: James Suplizio Date: Mon, 12 Nov 2018 16:08:41 -0800 Subject: [PATCH 2/2] Update the debug log level tests --- .../test/commands/forceStartApexDebugLogging.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/salesforcedx-vscode-core/test/commands/forceStartApexDebugLogging.test.ts b/packages/salesforcedx-vscode-core/test/commands/forceStartApexDebugLogging.test.ts index 710e62b377..8b6418799b 100644 --- a/packages/salesforcedx-vscode-core/test/commands/forceStartApexDebugLogging.test.ts +++ b/packages/salesforcedx-vscode-core/test/commands/forceStartApexDebugLogging.test.ts @@ -76,7 +76,7 @@ describe('Force Start Apex Debug Logging', () => { const updateTraceFlagsExecutor = new UpdateTraceFlagsExecutor(); const updateTraceFlagCmd = updateTraceFlagsExecutor.build(); expect(updateTraceFlagCmd.toCommand()).to.equal( - `sfdx force:data:record:update --sobjecttype TraceFlag --sobjectid ${fakeTraceFlagId} --values StartDate='${startDate.toUTCString()}' ExpirationDate='${endDate.toUTCString()}' --usetoolingapi --json --loglevel fatal` + `sfdx force:data:record:update --sobjecttype TraceFlag --sobjectid ${fakeTraceFlagId} --values StartDate='' ExpirationDate='${endDate.toUTCString()}' --usetoolingapi --json --loglevel fatal` ); }); @@ -92,7 +92,7 @@ describe('Force Start Apex Debug Logging', () => { const createTraceFlagExecutor = new CreateTraceFlag('testUserId'); const createTraceFlagCmd = createTraceFlagExecutor.build(); expect(createTraceFlagCmd.toCommand()).to.equal( - `sfdx force:data:record:create --sobjecttype TraceFlag --values tracedentityid='testUserId' logtype=developer_log debuglevelid=${fakeDebugLevelId} StartDate='${startDate.toUTCString()}' ExpirationDate='${endDate.toUTCString()} --usetoolingapi --json --loglevel fatal` + `sfdx force:data:record:create --sobjecttype TraceFlag --values tracedentityid='testUserId' logtype=developer_log debuglevelid=${fakeDebugLevelId} StartDate='' ExpirationDate='${endDate.toUTCString()} --usetoolingapi --json --loglevel fatal` ); });