Skip to content

Commit

Permalink
Merge pull request #2163 from SanjulaGanepola/feature/gather-logs
Browse files Browse the repository at this point in the history
Add `Download Logs` option to Help and Support view
  • Loading branch information
sebjulliand authored Jul 14, 2024
2 parents a8b0ecb + 38219fd commit a778a99
Show file tree
Hide file tree
Showing 11 changed files with 276 additions and 9 deletions.
34 changes: 33 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2954,6 +2954,7 @@
"typings": "npx -p typescript tsc ./src/extension.ts --declaration --allowJs --emitDeclarationOnly --outDir types --esModuleInterop -t es2022 --moduleResolution node --resolveJsonModule"
},
"devDependencies": {
"@types/adm-zip": "^0.5.5",
"@types/glob": "^7.1.3",
"@types/node": "^12.20.55",
"@types/source-map-support": "^0.5.6",
Expand All @@ -2974,7 +2975,7 @@
"dependencies": {
"@bendera/vscode-webview-elements": "^0.12.0",
"@ibm/ibmi-eventf-parser": "^1.0.2",
"@types/tmp": "^0.2.3",
"adm-zip": "^0.5.14",
"csv": "^6.2.1",
"ignore": "^5.1.9",
"node-ssh": "^13.1.0",
Expand Down
18 changes: 16 additions & 2 deletions src/api/IBMi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export default class IBMi {
tempRemoteFiles: { [name: string]: string } = {};
defaultUserLibraries: string[] = [];
outputChannel?: vscode.OutputChannel;
outputChannelContent?: string;

/**
* Used to store ASP numbers and their names
Expand Down Expand Up @@ -121,7 +122,7 @@ export default class IBMi {
/**
* @returns {Promise<{success: boolean, error?: any}>} Was succesful at connecting or not.
*/
async connect(connectionObject: ConnectionData, reconnecting?: boolean, reloadServerSettings: boolean = false, onConnectedOperations : Function[] = []): Promise<{ success: boolean, error?: any }> {
async connect(connectionObject: ConnectionData, reconnecting?: boolean, reloadServerSettings: boolean = false, onConnectedOperations: Function[] = []): Promise<{ success: boolean, error?: any }> {
return await Tools.withContext("code-for-ibmi:connecting", async () => {
try {
connectionObject.keepaliveInterval = 35000;
Expand All @@ -146,6 +147,7 @@ export default class IBMi {

if (!reconnecting) {
this.outputChannel = vscode.window.createOutputChannel(`Code for IBM i: ${this.currentConnectionName}`);
this.outputChannelContent = '';
}

let tempLibrarySet = false;
Expand Down Expand Up @@ -1051,11 +1053,19 @@ export default class IBMi {
if (this.outputChannel) {
this.outputChannel.append(content);
}
if (this.outputChannelContent !== undefined) {
this.outputChannelContent += content;
}
}

private determineClear() {
if (this.commandsExecuted > 150) {
if (this.outputChannel) this.outputChannel.clear();
if (this.outputChannel) {
this.outputChannel.clear();
}
if (this.outputChannelContent !== undefined) {
this.outputChannelContent = '';
}
this.commandsExecuted = 0;
}

Expand All @@ -1071,6 +1081,10 @@ export default class IBMi {
this.outputChannel.dispose();
}

if (this.outputChannelContent !== undefined) {
this.outputChannelContent = undefined;
}

await Promise.all([
vscode.commands.executeCommand("code-for-ibmi.refreshObjectBrowser"),
vscode.commands.executeCommand("code-for-ibmi.refreshLibraryListView"),
Expand Down
13 changes: 13 additions & 0 deletions src/locale/ids/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,19 @@
"file.unsaved.changes": "Filen har ikke-gemte ændringer.",
"generate.certificate": "Generer service certifikat",
"helpView.getStarted": "Dokumentation",
"helpView.downloadLogs": "",
"helpView.downloadLogs.gatheringLogs": "",
"helpView.downloadLogs.codeForIBMiLog": "",
"helpView.downloadLogs.debugServiceEclipseInstanceLog": "",
"helpView.downloadLogs.debugServiceLog": "",
"helpView.downloadLogs.downloadTo": "",
"helpView.downloadLogs.failed": "",
"helpView.downloadLogs.failedMessage": "",
"helpView.downloadLogs.noConnection": "",
"helpView.downloadLogs.noLogs": "",
"helpView.downloadLogs.open": "",
"helpView.downloadLogs.selectLogs": "",
"helpView.downloadLogs.success": "",
"helpView.officialForum": "Forum",
"helpView.reportIssue": "Opret en fejlrapport",
"helpView.reviewIssues": "Se fejlrapporter",
Expand Down
13 changes: 13 additions & 0 deletions src/locale/ids/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,19 @@
"file.unsaved.changes": "Die Datei enthält nicht gespeicherte Änderungen.",
"generate.certificate": "Servicezertifikat generieren",
"helpView.getStarted": "Loslegen",
"helpView.downloadLogs": "",
"helpView.downloadLogs.gatheringLogs": "",
"helpView.downloadLogs.codeForIBMiLog": "",
"helpView.downloadLogs.debugServiceEclipseInstanceLog": "",
"helpView.downloadLogs.debugServiceLog": "",
"helpView.downloadLogs.downloadTo": "",
"helpView.downloadLogs.failed": "",
"helpView.downloadLogs.failedMessage": "",
"helpView.downloadLogs.noConnection": "",
"helpView.downloadLogs.noLogs": "",
"helpView.downloadLogs.open": "",
"helpView.downloadLogs.selectLogs": "",
"helpView.downloadLogs.success": "",
"helpView.officialForum": "Offizielles Forum öffnen",
"helpView.reportIssue": "Ein Problem melden",
"helpView.reviewIssues": "Überprüfen Sie Probleme",
Expand Down
13 changes: 13 additions & 0 deletions src/locale/ids/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,19 @@
"file.unsaved.changes": "The file has unsaved changes.",
"generate.certificate": "Generate service certificate",
"helpView.getStarted": "Get started",
"helpView.downloadLogs": "Download Logs",
"helpView.downloadLogs.gatheringLogs": "Gathering logs...",
"helpView.downloadLogs.codeForIBMiLog": "Code for IBM i Log",
"helpView.downloadLogs.debugServiceEclipseInstanceLog": "Debug Service Eclipse Instance Log",
"helpView.downloadLogs.debugServiceLog": "Debug Service Log",
"helpView.downloadLogs.downloadTo": "Download To",
"helpView.downloadLogs.failed": "Failed to downloaded logs to {0}",
"helpView.downloadLogs.failedMessage": "Failed to download logs to {0}. {1}",
"helpView.downloadLogs.noConnection": "Please connect to an IBM i",
"helpView.downloadLogs.noLogs": "No logs to download",
"helpView.downloadLogs.open": "Open",
"helpView.downloadLogs.selectLogs": "Select the logs you would like to download",
"helpView.downloadLogs.success": "Successfully downloaded logs to {0}",
"helpView.officialForum": "Open official Forum",
"helpView.reportIssue": "Report an Issue",
"helpView.reviewIssues": "Review Issues",
Expand Down
12 changes: 12 additions & 0 deletions src/locale/ids/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,18 @@
"file.unsaved.changes": "Le fichier a des changements non sauvegardés.",
"generate.certificate": "Generer le certificat du service",
"helpView.getStarted": "Pour commencer",
"helpView.downloadLogs": "Télécharger les logs",
"helpView.downloadLogs.gatheringLogs": "Rassemblement des logs...",
"helpView.downloadLogs.codeForIBMiLog": "Log de Code for IBM i",
"helpView.downloadLogs.debugServiceEclipseInstanceLog": "Log de l'instance Eclipse du Debug Service",
"helpView.downloadLogs.debugServiceLog": "Log du Debug Service",
"helpView.downloadLogs.downloadTo": "Télécharger les logs",
"helpView.downloadLogs.failed": "Échec du téléchargement des logs vers {0}",
"helpView.downloadLogs.noConnection": "Connection requise à un IBM i",
"helpView.downloadLogs.noLogs": "Aucun log disponible au téléchargement",
"helpView.downloadLogs.open": "Ouvrir",
"helpView.downloadLogs.selectLogs": "Sélectionner les logs à télécharger",
"helpView.downloadLogs.success": "Logs téléchargés avec succès vers {0}",
"helpView.officialForum": "Forum officiel",
"helpView.reportIssue": "Déclarer un incident",
"helpView.reviewIssues": "Voir les incidents",
Expand Down
13 changes: 13 additions & 0 deletions src/locale/ids/no.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,19 @@
"file.unsaved.changes": "Filen har ulagrede endringer.",
"generate.certificate": "Generer service sertifikat",
"helpView.getStarted": "Dokumentasjon",
"helpView.downloadLogs": "",
"helpView.downloadLogs.gatheringLogs": "",
"helpView.downloadLogs.codeForIBMiLog": "",
"helpView.downloadLogs.debugServiceEclipseInstanceLog": "",
"helpView.downloadLogs.debugServiceLog": "",
"helpView.downloadLogs.downloadTo": "",
"helpView.downloadLogs.failed": "",
"helpView.downloadLogs.failedMessage": "",
"helpView.downloadLogs.noConnection": "",
"helpView.downloadLogs.noLogs": "",
"helpView.downloadLogs.open": "",
"helpView.downloadLogs.selectLogs": "",
"helpView.downloadLogs.success": "",
"helpView.officialForum": "Forum",
"helpView.reportIssue": " Opprett en feilrapport",
"helpView.reviewIssues": "Se feilrapporter",
Expand Down
13 changes: 13 additions & 0 deletions src/locale/ids/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,19 @@
"file.unsaved.changes": "Plik zawiera niezapisane zmiany.",
"generate.certificate": "Wygeneruj certyfikat usługi",
"helpView.getStarted": "Zaczynaj",
"helpView.downloadLogs": "",
"helpView.downloadLogs.gatheringLogs": "",
"helpView.downloadLogs.codeForIBMiLog": "",
"helpView.downloadLogs.debugServiceEclipseInstanceLog": "",
"helpView.downloadLogs.debugServiceLog": "",
"helpView.downloadLogs.downloadTo": "",
"helpView.downloadLogs.failed": "",
"helpView.downloadLogs.failedMessage": "",
"helpView.downloadLogs.noConnection": "",
"helpView.downloadLogs.noLogs": "",
"helpView.downloadLogs.open": "",
"helpView.downloadLogs.selectLogs": "",
"helpView.downloadLogs.success": "",
"helpView.officialForum": "Otwórz oficjalne Forum",
"helpView.reportIssue": "Zgłoś problem",
"helpView.reviewIssues": "Przeglądaj problemy",
Expand Down
Loading

0 comments on commit a778a99

Please sign in to comment.