sf-debug-log 0.0.22 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +89 -66
- package/lib/commands/debug/delete.d.ts +17 -0
- package/lib/commands/debug/delete.js +56 -0
- package/lib/commands/debug/delete.js.map +1 -0
- package/lib/commands/debug/retrieve.js +1 -17
- package/lib/commands/debug/retrieve.js.map +1 -1
- package/lib/utils.d.ts +2 -0
- package/lib/utils.js +35 -1
- package/lib/utils.js.map +1 -1
- package/messages/debug.delete.md +31 -0
- package/messages/debuglevel.new.md +1 -1
- package/oclif.manifest.json +55 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,66 +1,89 @@
|
|
|
1
|
-
# sf-debug-log
|
|
2
|
-
|
|
3
|
-
Commands to manage Salesforce debug logs.
|
|
4
|
-
|
|
5
|
-
Create trace flags for any user in the org selecting the debug level and time.
|
|
6
|
-
Retrive Apex logs related to a specific user to analyze them locally.
|
|
7
|
-
|
|
8
|
-
## Install
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
sf plugins install sf-debug-log
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Commands
|
|
15
|
-
|
|
16
|
-
<!-- commands -->
|
|
17
|
-
|
|
18
|
-
- [`sf trace new`](#sf-trace-new)
|
|
19
|
-
- [`sf debug retrieve`](#sf-debug-retrieve)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
# sf-debug-log
|
|
2
|
+
|
|
3
|
+
Commands to manage Salesforce debug logs.
|
|
4
|
+
|
|
5
|
+
Create trace flags for any user in the org selecting the debug level and time.
|
|
6
|
+
Retrive Apex logs related to a specific user to analyze them locally.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
sf plugins install sf-debug-log
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Commands
|
|
15
|
+
|
|
16
|
+
<!-- commands -->
|
|
17
|
+
|
|
18
|
+
- [`sf trace new`](#sf-trace-new)
|
|
19
|
+
- [`sf debug retrieve`](#sf-debug-retrieve)
|
|
20
|
+
- [`sf debuglevel new`](#sf-debuglevel-new)
|
|
21
|
+
|
|
22
|
+
## `sf trace new`
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
USAGE
|
|
26
|
+
$ sf trace new -o <value> [-u <value>] [-t <value>]
|
|
27
|
+
|
|
28
|
+
FLAGS
|
|
29
|
+
-o, --targetusername=<value> [required] Username or alias of the target Salesforce org.
|
|
30
|
+
-t, --time=<value> [default: 60] The number of minutes to trace.
|
|
31
|
+
-u, --name=<value> [default: targetusername] Username, Name, or ID of the user for whom you want to retrieve the logs.
|
|
32
|
+
|
|
33
|
+
GLOBAL FLAGS
|
|
34
|
+
--json Format output as json.
|
|
35
|
+
|
|
36
|
+
DESCRIPTION
|
|
37
|
+
Create a new trace flag.
|
|
38
|
+
|
|
39
|
+
This command is used to create a trace flag for a specific user in the Salesforce org.
|
|
40
|
+
|
|
41
|
+
EXAMPLES
|
|
42
|
+
sf trace new -o DeveloperEdition -u "Raffaele Preziosi" -t 10
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## `sf debug retrieve`
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
USAGE
|
|
49
|
+
$ sf debug retrieve -o <value> [-u <value>] [-t <value>] [-d <value>]
|
|
50
|
+
|
|
51
|
+
FLAGS
|
|
52
|
+
-d, --folder=<value> [default: .sfdx/tools/debug/logs] The folder where the retrieved log files will be stored.
|
|
53
|
+
-o, --targetusername=<value> (required) Username or alias of the target Salesforce org.
|
|
54
|
+
-t, --time=<value> [default: 60] The number of minutes to retrieve log files for.
|
|
55
|
+
-u, --user=<value> [default: targetusername] Username, Name, or ID of the user for whom you want to retrieve the logs.
|
|
56
|
+
|
|
57
|
+
GLOBAL FLAGS
|
|
58
|
+
--json Format output as json.
|
|
59
|
+
|
|
60
|
+
DESCRIPTION
|
|
61
|
+
Retrieve Apex log files from the Salesforce platform.
|
|
62
|
+
|
|
63
|
+
This command allows you to retrieve Apex log files from a Salesforce org.
|
|
64
|
+
|
|
65
|
+
EXAMPLES
|
|
66
|
+
sf debug retrieve -o DeveloperEdition -u "Raffaele Preziosi" -t 10
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## `sf debuglevel new`
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
USAGE
|
|
73
|
+
$ sf debuglevel new -o <value> [-n <value>]
|
|
74
|
+
|
|
75
|
+
FLAGS
|
|
76
|
+
-o, --targetusername=<value> [required] Username or alias of the target Salesforce org.
|
|
77
|
+
-n, --name=<value> [required] The developer name of the new DebugLevel.
|
|
78
|
+
|
|
79
|
+
GLOBAL FLAGS
|
|
80
|
+
--json Format output as json.
|
|
81
|
+
|
|
82
|
+
DESCRIPTION
|
|
83
|
+
Create a new DebugLevel.
|
|
84
|
+
|
|
85
|
+
Create a new DebugLevel assigning level for each category.
|
|
86
|
+
|
|
87
|
+
EXAMPLES
|
|
88
|
+
sf debuglevel new -o DeveloperEdition -n "DebugLevel"
|
|
89
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export type DebugDeleteResult = {
|
|
3
|
+
isSuccess: boolean;
|
|
4
|
+
error?: string;
|
|
5
|
+
};
|
|
6
|
+
export default class DebugDelete extends SfCommand<DebugDeleteResult> {
|
|
7
|
+
static readonly summary: string;
|
|
8
|
+
static readonly description: string;
|
|
9
|
+
static readonly examples: string[];
|
|
10
|
+
static readonly flags: {
|
|
11
|
+
targetusername: import("@oclif/core/lib/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
+
user: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
13
|
+
time: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
14
|
+
all: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
+
};
|
|
16
|
+
run(): Promise<DebugDeleteResult>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
|
|
4
|
+
const core_1 = require("@salesforce/core");
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
core_1.Messages.importMessagesDirectory(__dirname);
|
|
7
|
+
const messages = core_1.Messages.loadMessages('sf-debug-log', 'debug.delete');
|
|
8
|
+
class DebugDelete extends sf_plugins_core_1.SfCommand {
|
|
9
|
+
async run() {
|
|
10
|
+
const { flags } = await this.parse(DebugDelete);
|
|
11
|
+
const conn = flags.targetusername.getConnection();
|
|
12
|
+
let result;
|
|
13
|
+
try {
|
|
14
|
+
this.spinner.start('Deleting debug logs...');
|
|
15
|
+
const user = flags.user ? flags.user : conn.getUsername();
|
|
16
|
+
const userId = await (0, utils_1.getUserId)(conn, user);
|
|
17
|
+
const logs = await (0, utils_1.getLogs)(conn, userId, flags.time, flags.all);
|
|
18
|
+
await (0, utils_1.deleteLogs)(conn, logs);
|
|
19
|
+
this.log(`${logs.length} logs deleted successfully`);
|
|
20
|
+
this.spinner.stop();
|
|
21
|
+
return { isSuccess: true };
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
result = {
|
|
25
|
+
isSuccess: false,
|
|
26
|
+
error: err instanceof Error ? err.message : String(err),
|
|
27
|
+
};
|
|
28
|
+
throw messages.createError('error.deleteLogs', [result.error]);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
DebugDelete.summary = messages.getMessage('summary');
|
|
33
|
+
DebugDelete.description = messages.getMessage('description');
|
|
34
|
+
DebugDelete.examples = messages.getMessages('examples');
|
|
35
|
+
DebugDelete.flags = {
|
|
36
|
+
targetusername: sf_plugins_core_1.Flags.requiredOrg({
|
|
37
|
+
summary: messages.getMessage('flags.targetusername.summary'),
|
|
38
|
+
char: 'o',
|
|
39
|
+
required: true,
|
|
40
|
+
}),
|
|
41
|
+
user: sf_plugins_core_1.Flags.string({
|
|
42
|
+
summary: messages.getMessage('flags.user.summary'),
|
|
43
|
+
char: 'u',
|
|
44
|
+
}),
|
|
45
|
+
time: sf_plugins_core_1.Flags.integer({
|
|
46
|
+
summary: messages.getMessage('flags.time.summary'),
|
|
47
|
+
char: 't',
|
|
48
|
+
}),
|
|
49
|
+
all: sf_plugins_core_1.Flags.boolean({
|
|
50
|
+
summary: messages.getMessage('flags.all.summary'),
|
|
51
|
+
char: 'a',
|
|
52
|
+
default: false
|
|
53
|
+
})
|
|
54
|
+
};
|
|
55
|
+
exports.default = DebugDelete;
|
|
56
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../src/commands/debug/delete.ts"],"names":[],"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,MAAM,CAAC,GAAG,CAAC;aACxD,CAAC;YACF,MAAM,QAAQ,CAAC,WAAW,CAAC,kBAAkB,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;SAChE;IACH,CAAC;;AA7CsB,mBAAO,GAAG,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACzC,uBAAW,GAAG,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AACjD,oBAAQ,GAAG,QAAQ,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;AAE5C,iBAAK,GAAG;IAC7B,cAAc,EAAE,uBAAK,CAAC,WAAW,CAAC;QAChC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,CAAC;QAC5D,IAAI,EAAE,GAAG;QACT,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,IAAI,EAAE,uBAAK,CAAC,MAAM,CAAC;QACjB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAClD,IAAI,EAAE,GAAG;KACV,CAAC;IACF,IAAI,EAAE,uBAAK,CAAC,OAAO,CAAC;QAClB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC;QAClD,IAAI,EAAE,GAAG;KACV,CAAC;IACF,GAAG,EAAE,uBAAK,CAAC,OAAO,CAAC;QACjB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,mBAAmB,CAAC;QACjD,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,KAAK;KACf,CAAC;CACH,CAAC;kBAxBiB,WAAW"}
|
|
@@ -19,7 +19,7 @@ class Retrieve extends sf_plugins_core_1.SfCommand {
|
|
|
19
19
|
this.spinner.start('Retriving debug logs...');
|
|
20
20
|
const user = flags.user ? flags.user : conn.getUsername();
|
|
21
21
|
const userId = await (0, utils_1.getUserId)(conn, user);
|
|
22
|
-
const logs = await getLogs(conn, userId, flags.time);
|
|
22
|
+
const logs = await (0, utils_1.getLogs)(conn, userId, flags.time, false);
|
|
23
23
|
await saveLogs(conn, logs, flags.folder);
|
|
24
24
|
this.spinner.stop();
|
|
25
25
|
return { isSuccess: true };
|
|
@@ -58,22 +58,6 @@ Retrieve.flags = {
|
|
|
58
58
|
}),
|
|
59
59
|
};
|
|
60
60
|
exports.default = Retrieve;
|
|
61
|
-
async function getLogs(conn, userId, time) {
|
|
62
|
-
const dateTime = new Date(Date.now());
|
|
63
|
-
dateTime.setMinutes(dateTime.getMinutes() - time);
|
|
64
|
-
const startTime = dateTime.toISOString();
|
|
65
|
-
const queryResult = await conn.query(`SELECT Id, LogUser.Name, LogLength, Request, Operation,
|
|
66
|
-
Application, Status, DurationMilliseconds,
|
|
67
|
-
SystemModstamp, RequestIdentifier
|
|
68
|
-
FROM ApexLog
|
|
69
|
-
WHERE SystemModstamp > ${startTime}
|
|
70
|
-
AND LogUserId = '${userId}'
|
|
71
|
-
ORDER BY SystemModstamp DESC`);
|
|
72
|
-
if (queryResult.records.length === 0) {
|
|
73
|
-
throw new Error('No debug logs found');
|
|
74
|
-
}
|
|
75
|
-
return queryResult.records;
|
|
76
|
-
}
|
|
77
61
|
async function saveLogs(conn, logs, directory) {
|
|
78
62
|
// Use Promise.all to parallelize the download and save operations
|
|
79
63
|
await Promise.all(logs.map(async (log) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retrieve.js","sourceRoot":"","sources":["../../../src/commands/debug/retrieve.ts"],"names":[],"mappings":";;;;;AAAA,4DAA4D;AAC5D,iEAA+D;AAC/D,2CAAwD;AAExD,0EAAyC;AACzC,
|
|
1
|
+
{"version":3,"file":"retrieve.js","sourceRoot":"","sources":["../../../src/commands/debug/retrieve.ts"],"names":[],"mappings":";;;;;AAAA,4DAA4D;AAC5D,iEAA+D;AAC/D,2CAAwD;AAExD,0EAAyC;AACzC,uCAA6D;AAE7D,eAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,eAAQ,CAA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AC,UAAU,EAAE,CAAC;QAClC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,wHAAwH;QACxH,MAAM,QAAQ,GAAG,IAAI,KAAK,IAAI,OAAO,IAAI,OAAO,KAAK,GAAG,CAAC,oBAAoB,MAAM,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,SAAS,IAAI,GAAG,CAAC,MAAM,MAAM,CAAC;QACpI,6DAA6D;QAC7D,MAAM,iBAAiB,GAAG,IAAA,2BAAQ,EAAC,QAAQ,CAAC,CAAC;QAC7C,wHAAwH;QACxH,MAAM,QAAQ,GAAG,GAAG,SAAS,IAAI,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,iBAAiB,EAAE,CAAC;QACzE,IAAI;YACF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACrC,MAAM,IAAA,kBAAU,EAAC,QAAQ,EAAE,IAAc,CAAC,CAAC;SAC5C;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;SAC5C;IACH,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/lib/utils.d.ts
CHANGED
|
@@ -8,3 +8,5 @@ export declare function getActiveTraceFlag(conn: Connection, userId: string): Pr
|
|
|
8
8
|
export declare function getDebugLevels(conn: Connection): Promise<Record[]>;
|
|
9
9
|
export declare function createTraceFlag(conn: Connection, userId: string, debugLevelId: string, time: number): Promise<TraceNewResult>;
|
|
10
10
|
export declare function createDebugLevel(conn: Connection, debugLevel: Record): Promise<DebuglevelNewResult>;
|
|
11
|
+
export declare function getLogs(conn: Connection, userId: string, time: number | undefined, all: boolean): Promise<Record[]>;
|
|
12
|
+
export declare function deleteLogs(conn: Connection, logs: Record[]): Promise<void>;
|
package/lib/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createDebugLevel = exports.createTraceFlag = exports.getDebugLevels = exports.getActiveTraceFlag = exports.getUserId = exports.createFile = void 0;
|
|
3
|
+
exports.deleteLogs = exports.getLogs = exports.createDebugLevel = exports.createTraceFlag = exports.getDebugLevels = exports.getActiveTraceFlag = exports.getUserId = exports.createFile = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const util_1 = require("util");
|
|
6
6
|
const fs_1 = require("fs");
|
|
@@ -81,4 +81,38 @@ async function createDebugLevel(conn, debugLevel) {
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
exports.createDebugLevel = createDebugLevel;
|
|
84
|
+
async function getLogs(conn, userId, time, all) {
|
|
85
|
+
let startTime;
|
|
86
|
+
if (time) {
|
|
87
|
+
const dateTime = new Date(Date.now());
|
|
88
|
+
dateTime.setMinutes(dateTime.getMinutes() - time);
|
|
89
|
+
startTime = dateTime.toISOString();
|
|
90
|
+
}
|
|
91
|
+
const LOG_FIELDS = ['Id', 'LogUser.Name', 'LogLength', 'Request', 'Operation', 'Application', 'Status', 'DurationMilliseconds', 'SystemModstamp', 'RequestIdentifier'];
|
|
92
|
+
let queryString = `SELECT ${LOG_FIELDS.join(',')} FROM ApexLog`;
|
|
93
|
+
const whereConditions = [];
|
|
94
|
+
if (startTime) {
|
|
95
|
+
whereConditions.push(`SystemModstamp > ${startTime}`);
|
|
96
|
+
}
|
|
97
|
+
if (!all) {
|
|
98
|
+
whereConditions.push(`LogUserId = '${userId}'`);
|
|
99
|
+
}
|
|
100
|
+
if (whereConditions.length > 0) {
|
|
101
|
+
queryString += ` WHERE ${whereConditions.join(' AND ')}`;
|
|
102
|
+
}
|
|
103
|
+
queryString += ' ORDER BY SystemModstamp DESC';
|
|
104
|
+
const queryResult = await conn.query(queryString);
|
|
105
|
+
if (queryResult.records.length === 0) {
|
|
106
|
+
throw new Error('No debug logs found');
|
|
107
|
+
}
|
|
108
|
+
return queryResult.records;
|
|
109
|
+
}
|
|
110
|
+
exports.getLogs = getLogs;
|
|
111
|
+
async function deleteLogs(conn, logs) {
|
|
112
|
+
if (logs && logs.length > 0) {
|
|
113
|
+
const ids = logs.map((log) => log.Id).filter((id) => id !== undefined);
|
|
114
|
+
await conn.sobject('ApexLog').del(ids);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.deleteLogs = deleteLogs;
|
|
84
118
|
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA,+BAA+B;AAC/B,+BAAiC;AACjC,2BAAsC;AAMtC,MAAM,YAAY,GAAG,IAAA,gBAAS,EAAC,UAAK,CAAC,CAAC;AACtC,MAAM,gBAAgB,GAAG,IAAA,gBAAS,EAAC,cAAS,CAAC,CAAC;AAE9C,MAAM,uBAAuB,GAAG,KAAK,CAAC;AAE/B,KAAK,UAAU,UAAU,CAAC,IAAY,EAAE,QAAgB;IAC7D,MAAM,YAAY,CAAC,IAAA,cAAO,EAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvD,MAAM,gBAAgB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACzC,CAAC;AAHD,gCAGC;AAEM,KAAK,UAAU,SAAS,CAAC,UAAsB,EAAE,SAAiB;IACvE,IAAI,MAAM,CAAC;IACX,IAAI,YAAY,CAAC,SAAS,CAAC,EAAE;QAC3B,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;KACpF;SAAM,IAAI,IAAI,CAAC,SAAS,CAAC,EAAE;QAC1B,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE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
|
|
6
|
+
|
|
7
|
+
Deletes Apex log files from a Salesforce org.
|
|
8
|
+
|
|
9
|
+
# flags.user.summary
|
|
10
|
+
|
|
11
|
+
[default: targetusername] Username, Name, or ID of the user for whom you want to delete the logs.
|
|
12
|
+
|
|
13
|
+
# flags.targetusername.summary
|
|
14
|
+
|
|
15
|
+
Username or alias of the target Salesforce org.
|
|
16
|
+
|
|
17
|
+
# flags.time.summary
|
|
18
|
+
|
|
19
|
+
The number of minutes to retrieve log files for.
|
|
20
|
+
|
|
21
|
+
# flags.all.summary
|
|
22
|
+
|
|
23
|
+
Delete log files for all users.
|
|
24
|
+
|
|
25
|
+
# error.deleteLogs
|
|
26
|
+
|
|
27
|
+
Failed to delete logs: %s.
|
|
28
|
+
|
|
29
|
+
# examples
|
|
30
|
+
|
|
31
|
+
sf debug delete -u "Raffaele Preziosi" -t 60
|
package/oclif.manifest.json
CHANGED
|
@@ -1,6 +1,59 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.1.1",
|
|
3
3
|
"commands": {
|
|
4
|
+
"debug:delete": {
|
|
5
|
+
"id": "debug:delete",
|
|
6
|
+
"summary": "Delete Apex log files from a Salesforce org.",
|
|
7
|
+
"description": "Deletes Apex log files from a Salesforce org.",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"pluginName": "sf-debug-log",
|
|
10
|
+
"pluginAlias": "sf-debug-log",
|
|
11
|
+
"pluginType": "core",
|
|
12
|
+
"aliases": [],
|
|
13
|
+
"examples": [
|
|
14
|
+
"sf debug delete -u \"Raffaele Preziosi\" -t 60"
|
|
15
|
+
],
|
|
16
|
+
"flags": {
|
|
17
|
+
"json": {
|
|
18
|
+
"name": "json",
|
|
19
|
+
"type": "boolean",
|
|
20
|
+
"description": "Format output as json.",
|
|
21
|
+
"helpGroup": "GLOBAL",
|
|
22
|
+
"allowNo": false
|
|
23
|
+
},
|
|
24
|
+
"targetusername": {
|
|
25
|
+
"name": "targetusername",
|
|
26
|
+
"type": "option",
|
|
27
|
+
"char": "o",
|
|
28
|
+
"summary": "Username or alias of the target Salesforce org.",
|
|
29
|
+
"required": true,
|
|
30
|
+
"multiple": false
|
|
31
|
+
},
|
|
32
|
+
"user": {
|
|
33
|
+
"name": "user",
|
|
34
|
+
"type": "option",
|
|
35
|
+
"char": "u",
|
|
36
|
+
"summary": "[default: targetusername] Username, Name, or ID of the user for whom you want to delete the logs.",
|
|
37
|
+
"multiple": false
|
|
38
|
+
},
|
|
39
|
+
"time": {
|
|
40
|
+
"name": "time",
|
|
41
|
+
"type": "option",
|
|
42
|
+
"char": "t",
|
|
43
|
+
"summary": "The number of minutes to retrieve log files for.",
|
|
44
|
+
"multiple": false
|
|
45
|
+
},
|
|
46
|
+
"all": {
|
|
47
|
+
"name": "all",
|
|
48
|
+
"type": "boolean",
|
|
49
|
+
"char": "a",
|
|
50
|
+
"summary": "Delete log files for all users.",
|
|
51
|
+
"allowNo": false
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"args": {},
|
|
55
|
+
"hasDynamicHelp": true
|
|
56
|
+
},
|
|
4
57
|
"debug:retrieve": {
|
|
5
58
|
"id": "debug:retrieve",
|
|
6
59
|
"summary": "Retrieve Apex log files from the Salesforce platform.",
|
|
@@ -59,7 +112,7 @@
|
|
|
59
112
|
"debuglevel:new": {
|
|
60
113
|
"id": "debuglevel:new",
|
|
61
114
|
"summary": "Create a new DebugLevel.",
|
|
62
|
-
"description": "
|
|
115
|
+
"description": "Create a new DebugLevel assigning level for each category.",
|
|
63
116
|
"strict": true,
|
|
64
117
|
"pluginName": "sf-debug-log",
|
|
65
118
|
"pluginAlias": "sf-debug-log",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sf-debug-log",
|
|
3
3
|
"description": "Manage Salesforce Debug Logs",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@oclif/core": "^2.11.8",
|
|
7
7
|
"@salesforce/core": "^5.2.0",
|
|
@@ -199,4 +199,4 @@
|
|
|
199
199
|
}
|
|
200
200
|
},
|
|
201
201
|
"author": "Raffaele Preziosi"
|
|
202
|
-
}
|
|
202
|
+
}
|