Skip to content

Commit f0b9dbf

Browse files
committed
Use new LogOutputChannel for improved logging experience
1 parent 40f770c commit f0b9dbf

38 files changed

+158
-171
lines changed

.vscode/launch.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
"csharp-test-profile",
2525
"${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/slnWithCsproj.code-workspace",
2626
"--extensionDevelopmentPath=${workspaceRoot}",
27-
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests"
27+
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests",
28+
"--log",
29+
"ms-dotnettools.csharp:trace"
2830
],
2931
"env": {
3032
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
@@ -49,7 +51,9 @@
4951
"csharp-test-profile",
5052
"${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/devkit_slnWithCsproj.code-workspace",
5153
"--extensionDevelopmentPath=${workspaceRoot}",
52-
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests"
54+
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests",
55+
"--log",
56+
"ms-dotnettools.csharp:trace"
5357
],
5458
"env": {
5559
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
@@ -74,7 +78,9 @@
7478
"csharp-test-profile",
7579
"${workspaceRoot}/test/razor/razorIntegrationTests/testAssets/BasicRazorApp2_1/.vscode/lsp_tools_host_BasicRazorApp2_1.code-workspace",
7680
"--extensionDevelopmentPath=${workspaceRoot}",
77-
"--extensionTestsPath=${workspaceRoot}/out/test/razor/razorIntegrationTests"
81+
"--extensionTestsPath=${workspaceRoot}/out/test/razor/razorIntegrationTests",
82+
"--log",
83+
"ms-dotnettools.csharp:trace"
7884
],
7985
"env": {
8086
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",

SUPPORT.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,25 @@ We highly recommend using the C# extension's built-in command, `CSharp: Report a
1919

2020
The template has a section to include the `C#` output window logs. These logs are not automatically included as they may contain personal information (such as full file paths and project names), but they are key to resolving problems.
2121

22-
1. First, set `dotnet.server.trace` to `Trace` in VSCode settings
23-
![settings window showing trace option](./docs/trace_logs.png)
24-
2. Reload the window via the `Developer: Reload Window` (`workbench.action.reloadWindow`) command
22+
1. Find the `C#` output window (`View` -> `Output`) and set the log level to `Trace`
23+
![c# output window showing trace option](./docs/csharp_trace.png)
24+
2. Reproduce the issue
25+
3. In the `C#` output window, select all (e.g. `cntrl+a`) and copy paste into the issue template under the 'C# Log' section. If you need to redact file paths and other information, please do so at this time.
26+
4. Once the logs are collected, reset the window log level to `Info`
27+
28+
If the issue only reproduces on extension startup, you can set `Trace` as the default (see screenshot above), reload the window, and trace logs will be captured on startup.
29+
30+
##### C# LSP Trace Logs
31+
Sometimes we need to know exactly what requests were sent to the Roslyn language server. To capture these logs:
32+
33+
1. Set the log level to `Trace` for the `C#` output window as described above.
34+
2. Find the `C# LSP Trace Logs` output window
2535
3. Reproduce the issue
26-
4. Open the output window via `View` -> `Output` and change to the `C#` output window.
27-
5. Select all (e.g. cntrl+a) and copy paste into the issue template under the 'C# Log' section. If you need to redact file paths and other information, please do so at this time.
28-
6. Once the logs are collected, reset `dotnet.server.trace` back to `Information`
36+
4. Copy the contents of the `C# LSP Trace Logs` output window.
2937

30-
Oftentimes the C# logs are enough, but sometimes when dealing with LSP server issues, the LSP trace logs are required. These can be found by following the same steps as above, but using the `C# LSP Trace Logs` output window instead.
38+
##### Other ways to set the log level
39+
1. When launching VSCode from the CLI, pass the `--log ms-dotnettools.csharp:trace` parameter.
40+
2. Invoke the `Developer: Set Log Level` command from the VSCode command palette, find the `C#` entry and set the level.
3141

3242
#### Project loading problems
3343

docs/csharp_trace.png

10.1 KB
Loading

docs/trace_logs.png

-12.6 KB
Binary file not shown.

package-lock.json

Lines changed: 10 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
"@types/tmp": "0.0.33",
133133
"@types/unzipper": "^0.9.1",
134134
"@types/uuid": "^9.0.1",
135-
"@types/vscode": "1.73.0",
135+
"@types/vscode": "1.93.0",
136136
"@types/yauzl": "2.10.0",
137137
"@typescript-eslint/eslint-plugin": "^8.5.0",
138138
"@typescript-eslint/parser": "^8.5.0",
@@ -689,7 +689,7 @@
689689
}
690690
],
691691
"engines": {
692-
"vscode": "^1.75.0"
692+
"vscode": "^1.93.0"
693693
},
694694
"activationEvents": [
695695
"onDebugInitialConfigurations",
@@ -1441,21 +1441,6 @@
14411441
"default": false,
14421442
"description": "%configuration.dotnet.server.waitForDebugger%"
14431443
},
1444-
"dotnet.server.trace": {
1445-
"scope": "window",
1446-
"type": "string",
1447-
"enum": [
1448-
"Trace",
1449-
"Debug",
1450-
"Information",
1451-
"Warning",
1452-
"Error",
1453-
"Critical",
1454-
"None"
1455-
],
1456-
"default": "Information",
1457-
"description": "%configuration.dotnet.server.trace%"
1458-
},
14591444
"dotnet.server.extensionPaths": {
14601445
"scope": "machine-overridable",
14611446
"type": [

package.nls.cs.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
"configuration.dotnet.server.startTimeout": "Určuje časový limit (v ms), aby se klient úspěšně spustil a připojil k jazykovému serveru.",
7070
"configuration.dotnet.server.suppressLspErrorToasts": "Potlačí zobrazování informačních zpráv o chybách, pokud na serveru dojde k chybě, ze které se dá zotavit.",
7171
"configuration.dotnet.server.suppressMiscellaneousFilesToasts": "Potlačí zobrazování informačních upozornění, pokud je aktivní dokument mimo otevřený pracovní prostor.",
72-
"configuration.dotnet.server.trace": "Nastaví úroveň protokolování pro jazykový server",
7372
"configuration.dotnet.server.useServerGC": "Nakonfigurujte jazykový server tak, aby používal uvolňování paměti serveru .NET. Uvolňování paměti serveru obecně přináší vyšší výkon za cenu vyšší spotřeby paměti.",
7473
"configuration.dotnet.server.waitForDebugger": "Při spuštění serveru předá příznak --debug, aby bylo možné připojit ladicí program. (Dříve omnisharp.waitForDebugger)",
7574
"configuration.dotnet.symbolSearch.searchReferenceAssemblies": "Hledat symboly v referenčních sestaveních Ovlivňuje funkce, které vyžadují vyhledávání symbolů, například přidání importů.",

package.nls.de.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
"configuration.dotnet.server.startTimeout": "Gibt ein Timeout (in ms) an, mit dem der Client erfolgreich gestartet und eine Verbindung mit dem Sprachserver hergestellt werden kann.",
7070
"configuration.dotnet.server.suppressLspErrorToasts": "Unterdrückt, dass Fehler-Popups angezeigt werden, wenn auf dem Server ein wiederherstellbarer Fehler auftritt.",
7171
"configuration.dotnet.server.suppressMiscellaneousFilesToasts": "Hiermit wird die Anzeige von Popupwarnungen unterdrückt, wenn sich das aktive Dokument außerhalb des geöffneten Arbeitsbereichs befindet.",
72-
"configuration.dotnet.server.trace": "Legt den Protokolliergrad für den Sprachserver fest.",
7372
"configuration.dotnet.server.useServerGC": "Konfigurieren Sie den Sprachserver für die Verwendung der GC des .NET-Servers. Die GC auf dem Server bietet im Allgemeinen eine bessere Leistung bei einem höheren Arbeitsspeicherverbrauch.",
7473
"configuration.dotnet.server.waitForDebugger": "Übergibt das Flag \"--debug\" beim Starten des Servers, damit ein Debugger angefügt werden kann. (Zuvor \"omnisharp.waitForDebugger\")",
7574
"configuration.dotnet.symbolSearch.searchReferenceAssemblies": "Symbole in Verweisassemblys suchen. Dies wirkt sich auf Features aus, die eine Symbolsuche erfordern, z. B. Importe hinzufügen.",

package.nls.es.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
"configuration.dotnet.server.startTimeout": "Especifica un tiempo de espera (en ms) para que el cliente se inicie correctamente y se conecte al servidor de lenguaje.",
7070
"configuration.dotnet.server.suppressLspErrorToasts": "Suprime la visualización de notificaciones del sistema de error si el servidor encuentra un error recuperable.",
7171
"configuration.dotnet.server.suppressMiscellaneousFilesToasts": "Impida que aparezcan notificaciones de advertencia si el documento activo se encuentra fuera del área de trabajo abierta.",
72-
"configuration.dotnet.server.trace": "Establece el nivel de registro para el servidor de lenguaje",
7372
"configuration.dotnet.server.useServerGC": "Configure el servidor de idiomas para usar la recolección de elementos no utilizados del servidor de .NET. La recolección de elementos no utilizados del servidor suele proporcionar un mejor rendimiento a costa de un mayor consumo de memoria.",
7473
"configuration.dotnet.server.waitForDebugger": "Pasa la marca --debug al iniciar el servidor para permitir que se adjunte un depurador. (Anteriormente \"omnisharp.waitForDebugger\")",
7574
"configuration.dotnet.symbolSearch.searchReferenceAssemblies": "Buscar símbolos en ensamblados de referencia. Afecta a las características y requiere la búsqueda de símbolos, como agregar importaciones.",

package.nls.fr.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
"configuration.dotnet.server.startTimeout": "Spécifie un délai d'attente (en ms) pour que le client démarre et se connecte avec succès au serveur de langue.",
7070
"configuration.dotnet.server.suppressLspErrorToasts": "Supprime l’affichage des notifications toast d’erreur si le serveur a rencontré une erreur récupérable.",
7171
"configuration.dotnet.server.suppressMiscellaneousFilesToasts": "Supprimez l’affichage des toasts d’avertissement si le document actif se situe en dehors de l’espace de travail ouvert.",
72-
"configuration.dotnet.server.trace": "Définit le niveau de journalisation pour le serveur de langage",
7372
"configuration.dotnet.server.useServerGC": "Configurez le serveur de langue pour qu’il utilise le serveur .NET GC. Le serveur GC offre généralement un meilleur niveau de performance au prix d’une consommation de mémoire plus élevée.",
7473
"configuration.dotnet.server.waitForDebugger": "Passe le drapeau – debug lors du lancement du serveur pour permettre à un débogueur d’être attaché. (Précédemment `omnisharp.waitForDebugger`)",
7574
"configuration.dotnet.symbolSearch.searchReferenceAssemblies": "Rechercher des symboles dans les assemblys de référence. Elle affecte les fonctionnalités nécessitant une recherche de symboles, comme l’ajout d’importations.",

0 commit comments

Comments
 (0)