Skip to content

Commit

Permalink
Use new LogOutputChannel for improved logging experience
Browse files Browse the repository at this point in the history
  • Loading branch information
dibarbet committed Oct 29, 2024
1 parent 40f770c commit f0b9dbf
Show file tree
Hide file tree
Showing 38 changed files with 158 additions and 171 deletions.
12 changes: 9 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
"csharp-test-profile",
"${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/slnWithCsproj.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests"
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests",
"--log",
"ms-dotnettools.csharp:trace"
],
"env": {
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
Expand All @@ -49,7 +51,9 @@
"csharp-test-profile",
"${workspaceRoot}/test/lsptoolshost/integrationTests/testAssets/slnWithCsproj/.vscode/devkit_slnWithCsproj.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests"
"--extensionTestsPath=${workspaceRoot}/out/test/lsptoolshost/integrationTests",
"--log",
"ms-dotnettools.csharp:trace"
],
"env": {
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
Expand All @@ -74,7 +78,9 @@
"csharp-test-profile",
"${workspaceRoot}/test/razor/razorIntegrationTests/testAssets/BasicRazorApp2_1/.vscode/lsp_tools_host_BasicRazorApp2_1.code-workspace",
"--extensionDevelopmentPath=${workspaceRoot}",
"--extensionTestsPath=${workspaceRoot}/out/test/razor/razorIntegrationTests"
"--extensionTestsPath=${workspaceRoot}/out/test/razor/razorIntegrationTests",
"--log",
"ms-dotnettools.csharp:trace"
],
"env": {
"CODE_EXTENSIONS_PATH": "${workspaceRoot}",
Expand Down
24 changes: 17 additions & 7 deletions SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,25 @@ We highly recommend using the C# extension's built-in command, `CSharp: Report a

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.

1. First, set `dotnet.server.trace` to `Trace` in VSCode settings
![settings window showing trace option](./docs/trace_logs.png)
2. Reload the window via the `Developer: Reload Window` (`workbench.action.reloadWindow`) command
1. Find the `C#` output window (`View` -> `Output`) and set the log level to `Trace`
![c# output window showing trace option](./docs/csharp_trace.png)
2. Reproduce the issue
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.
4. Once the logs are collected, reset the window log level to `Info`

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.

##### C# LSP Trace Logs
Sometimes we need to know exactly what requests were sent to the Roslyn language server. To capture these logs:

1. Set the log level to `Trace` for the `C#` output window as described above.
2. Find the `C# LSP Trace Logs` output window
3. Reproduce the issue
4. Open the output window via `View` -> `Output` and change to the `C#` output window.
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.
6. Once the logs are collected, reset `dotnet.server.trace` back to `Information`
4. Copy the contents of the `C# LSP Trace Logs` output window.

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.
##### Other ways to set the log level
1. When launching VSCode from the CLI, pass the `--log ms-dotnettools.csharp:trace` parameter.
2. Invoke the `Developer: Set Log Level` command from the VSCode command palette, find the `C#` entry and set the level.

#### Project loading problems

Expand Down
Binary file added docs/csharp_trace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/trace_logs.png
Binary file not shown.
19 changes: 10 additions & 9 deletions package-lock.json

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

19 changes: 2 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"@types/tmp": "0.0.33",
"@types/unzipper": "^0.9.1",
"@types/uuid": "^9.0.1",
"@types/vscode": "1.73.0",
"@types/vscode": "1.93.0",
"@types/yauzl": "2.10.0",
"@typescript-eslint/eslint-plugin": "^8.5.0",
"@typescript-eslint/parser": "^8.5.0",
Expand Down Expand Up @@ -689,7 +689,7 @@
}
],
"engines": {
"vscode": "^1.75.0"
"vscode": "^1.93.0"
},
"activationEvents": [
"onDebugInitialConfigurations",
Expand Down Expand Up @@ -1441,21 +1441,6 @@
"default": false,
"description": "%configuration.dotnet.server.waitForDebugger%"
},
"dotnet.server.trace": {
"scope": "window",
"type": "string",
"enum": [
"Trace",
"Debug",
"Information",
"Warning",
"Error",
"Critical",
"None"
],
"default": "Information",
"description": "%configuration.dotnet.server.trace%"
},
"dotnet.server.extensionPaths": {
"scope": "machine-overridable",
"type": [
Expand Down
1 change: 0 additions & 1 deletion package.nls.cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"configuration.dotnet.server.startTimeout": "Určuje časový limit (v ms), aby se klient úspěšně spustil a připojil k jazykovému serveru.",
"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.",
"configuration.dotnet.server.suppressMiscellaneousFilesToasts": "Potlačí zobrazování informačních upozornění, pokud je aktivní dokument mimo otevřený pracovní prostor.",
"configuration.dotnet.server.trace": "Nastaví úroveň protokolování pro jazykový server",
"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.",
"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)",
"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ů.",
Expand Down
1 change: 0 additions & 1 deletion package.nls.de.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"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.",
"configuration.dotnet.server.suppressLspErrorToasts": "Unterdrückt, dass Fehler-Popups angezeigt werden, wenn auf dem Server ein wiederherstellbarer Fehler auftritt.",
"configuration.dotnet.server.suppressMiscellaneousFilesToasts": "Hiermit wird die Anzeige von Popupwarnungen unterdrückt, wenn sich das aktive Dokument außerhalb des geöffneten Arbeitsbereichs befindet.",
"configuration.dotnet.server.trace": "Legt den Protokolliergrad für den Sprachserver fest.",
"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.",
"configuration.dotnet.server.waitForDebugger": "Übergibt das Flag \"--debug\" beim Starten des Servers, damit ein Debugger angefügt werden kann. (Zuvor \"omnisharp.waitForDebugger\")",
"configuration.dotnet.symbolSearch.searchReferenceAssemblies": "Symbole in Verweisassemblys suchen. Dies wirkt sich auf Features aus, die eine Symbolsuche erfordern, z. B. Importe hinzufügen.",
Expand Down
1 change: 0 additions & 1 deletion package.nls.es.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"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.",
"configuration.dotnet.server.suppressLspErrorToasts": "Suprime la visualización de notificaciones del sistema de error si el servidor encuentra un error recuperable.",
"configuration.dotnet.server.suppressMiscellaneousFilesToasts": "Impida que aparezcan notificaciones de advertencia si el documento activo se encuentra fuera del área de trabajo abierta.",
"configuration.dotnet.server.trace": "Establece el nivel de registro para el servidor de lenguaje",
"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.",
"configuration.dotnet.server.waitForDebugger": "Pasa la marca --debug al iniciar el servidor para permitir que se adjunte un depurador. (Anteriormente \"omnisharp.waitForDebugger\")",
"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.",
Expand Down
1 change: 0 additions & 1 deletion package.nls.fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"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.",
"configuration.dotnet.server.suppressLspErrorToasts": "Supprime l’affichage des notifications toast d’erreur si le serveur a rencontré une erreur récupérable.",
"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.",
"configuration.dotnet.server.trace": "Définit le niveau de journalisation pour le serveur de langage",
"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.",
"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`)",
"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.",
Expand Down
1 change: 0 additions & 1 deletion package.nls.it.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"configuration.dotnet.server.startTimeout": "Specifica un timeout (in ms) per l'avvio del client e la sua connessione al server di linguaggio.",
"configuration.dotnet.server.suppressLspErrorToasts": "Impedisce la visualizzazione degli avvisi popup di errore se il server rileva un errore reversibile.",
"configuration.dotnet.server.suppressMiscellaneousFilesToasts": "Non visualizzare avvisi popup se il documento attivo si trova all'esterno dell'area di lavoro aperta.",
"configuration.dotnet.server.trace": "Imposta il livello di registrazione per il server di linguaggio",
"configuration.dotnet.server.useServerGC": "Configurare il server del linguaggio per l'utilizzo di Garbage Collection del server .NET. Garbage Collection del server offre in genere prestazioni migliori a spese di un consumo di memoria più elevato.",
"configuration.dotnet.server.waitForDebugger": "Passa il flag --debug all'avvio del server per consentire il collegamento di un debugger. (In precedenza “omnisharp.waitForDebugger”)",
"configuration.dotnet.symbolSearch.searchReferenceAssemblies": "Cerca simboli negli assembly di riferimento. Influisce sulle funzionalità che richiedono la ricerca di simboli, ad esempio l'aggiunta di importazioni.",
Expand Down
1 change: 0 additions & 1 deletion package.nls.ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"configuration.dotnet.server.startTimeout": "クライアントが正常に起動して言語サーバーに接続するためのタイムアウト (ミリ秒) を指定します。",
"configuration.dotnet.server.suppressLspErrorToasts": "サーバーで回復可能なエラーが発生した場合に、エラー トーストが表示されないようにします。",
"configuration.dotnet.server.suppressMiscellaneousFilesToasts": "開いているワークスペースに属さないドキュメントがアクティブである場合に、警告トーストを表示しないようにします。",
"configuration.dotnet.server.trace": "言語サーバーのログ記録レベルを設定する",
"configuration.dotnet.server.useServerGC": ".NET サーバーのガベージ コレクションを使用するように言語サーバーを構成します。サーバー GC は一般に、メモリ消費量が高いことをコストにパフォーマンスを向上させます。",
"configuration.dotnet.server.waitForDebugger": "デバッガーのアタッチを許可するために、サーバーを起動するときに --debug フラグを渡します。(以前の `omnisharp.waitForDebugger`)",
"configuration.dotnet.symbolSearch.searchReferenceAssemblies": "参照アセンブリ内のシンボルを検索します。影響を受ける機能には、インポートの追加などのシンボル検索が必要です。",
Expand Down
1 change: 0 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"configuration.dotnet.server.componentPaths.xamlTools": "Overrides the folder path for the .xamlTools component of the language server",
"configuration.dotnet.server.startTimeout": "Specifies a timeout (in ms) for the client to successfully start and connect to the language server.",
"configuration.dotnet.server.waitForDebugger": "Passes the --debug flag when launching the server to allow a debugger to be attached. (Previously `omnisharp.waitForDebugger`)",
"configuration.dotnet.server.trace": "Sets the logging level for the language server",
"configuration.dotnet.server.extensionPaths": "Override for path to language server --extension arguments",
"configuration.dotnet.server.crashDumpPath": "Sets a folder path where crash dumps are written to if the language server crashes. Must be writeable by the user.",
"configuration.dotnet.server.suppressLspErrorToasts": "Suppresses error toasts from showing up if the server encounters a recoverable error.",
Expand Down
1 change: 0 additions & 1 deletion package.nls.ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"configuration.dotnet.server.startTimeout": "클라이언트가 언어 서버를 시작하고 연결하기 위한 시간 제한(밀리초)을 지정합니다.",
"configuration.dotnet.server.suppressLspErrorToasts": "서버에서 복구 가능한 오류가 발생하는 경우 오류 알림이 표시되지 않도록 합니다.",
"configuration.dotnet.server.suppressMiscellaneousFilesToasts": "활성 문서가 열려 있는 작업 영역 밖에 있는 경우 경고 알림이 표시되지 않도록 합니다.",
"configuration.dotnet.server.trace": "언어 서버의 로깅 수준을 설정합니다.",
"configuration.dotnet.server.useServerGC": ".NET 서버 가비지 수집을 사용하도록 언어 서버를 구성합니다. 서버 가비지 수집은 일반적으로 메모리 사용량이 많을수록 성능이 향상됩니다.",
"configuration.dotnet.server.waitForDebugger": "디버거 연결을 허용하기 위해 서버를 시작할 때 --debug 플래그를 전달합니다(이전 `omnisharp.waitForDebugger`).",
"configuration.dotnet.symbolSearch.searchReferenceAssemblies": "참조 어셈블리에서 기호를 검색합니다. 가져오기 추가와 같은 기호 검색이 필요한 기능에 영향을 줍니다.",
Expand Down
1 change: 0 additions & 1 deletion package.nls.pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"configuration.dotnet.server.startTimeout": "Określa limit czasu (w ms) dla pomyślnego uruchomienia klienta i nawiązania połączenia z serwerem języka.",
"configuration.dotnet.server.suppressLspErrorToasts": "Pomija wyświetlanie wyskakujących powiadomień o błędach, jeśli serwer napotka błąd do odzyskania.",
"configuration.dotnet.server.suppressMiscellaneousFilesToasts": "Pomiń wyświetlanie wyskakujących powiadomień ostrzegawczych, jeśli dokument aktywny znajduje się poza otwartym obszarem roboczym.",
"configuration.dotnet.server.trace": "Ustawia poziom rejestrowania dla serwera języka",
"configuration.dotnet.server.useServerGC": "Skonfiguruj serwer językowy do używania funkcji odzyskiwania pamięci serwera .NET. Odzyskiwanie pamięci serwera zasadniczo zapewnia lepszą wydajność przy wyższym zużyciu pamięci.",
"configuration.dotnet.server.waitForDebugger": "Przekazuje flagę --debug podczas uruchamiania serwera, aby umożliwić dołączenie debugera. (Wcześniej „omnisharp.waitForDebugger”)",
"configuration.dotnet.symbolSearch.searchReferenceAssemblies": "Wyszukaj symbole w zestawach odwołań. Ma to wpływ na funkcje wymagające wyszukiwania symboli, takie jak dodawanie importów.",
Expand Down
1 change: 0 additions & 1 deletion package.nls.pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"configuration.dotnet.server.startTimeout": "Especifica um tempo limite (em ms) para o cliente iniciar e conectar-se com êxito ao servidor de idioma.",
"configuration.dotnet.server.suppressLspErrorToasts": "Suprime a exibição de notificações do erro se o servidor encontrar um erro recuperável.",
"configuration.dotnet.server.suppressMiscellaneousFilesToasts": "Suprima a exibição de notificações de aviso do sistema se o documento ativo estiver fora do workspace aberto.",
"configuration.dotnet.server.trace": "Define o nível de log para o servidor de idiomas",
"configuration.dotnet.server.useServerGC": "Configure o servidor de linguagem para usar a coleta de lixo do servidor do .NET. A coleta de lixo do servidor geralmente fornece um melhor desempenho às custas de um consumo de memória mais alto.",
"configuration.dotnet.server.waitForDebugger": "Passa o sinalizador --debug ao iniciar o servidor para permitir que um depurador seja anexado. (Anteriormente `omnisharp.waitForDebugger`)",
"configuration.dotnet.symbolSearch.searchReferenceAssemblies": "Pesquisar símbolos em montagens de referência. Afeta os recursos que exigem pesquisa de símbolos, como adicionar importações.",
Expand Down
Loading

0 comments on commit f0b9dbf

Please sign in to comment.