Skip to content

Move documentation on how to enable extended logging to its own document #2024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Contributor Documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ The following documentation documents are primarily intended for developers of S
- [Background Indexing](Background%20Indexing.md)
- [BSP Extension](BSP%20Extensions.md)
- [Debugging Memory Leaks](Debugging%20Memory%20Leaks.md)
- [Environment Variables](Environment%20Variables.md)
- [Files To Reindex](Files%20To%20Reindex.md)
- [Implementing a BSP server](Implementing%20a%20BSP%20server.md)
- [LSP Extensions](LSP%20Extensions.md)
- [Logging](Logging.md)
- [LSP Extensions](LSP%20Extensions.md)
- [Modules](Modules.md)
- [Overview](Overview.md)
- [Swift Version](Swift%20Version.md)
Expand Down
22 changes: 0 additions & 22 deletions Documentation/Diagnose Bundle.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,3 @@ You may want to inspect the bundle to determine whether you're willing to share
- Versions of Swift installed on your system
- If possible, a minimized project that caused SourceKit to crash
- If possible, a minimized project that caused the Swift compiler to crash

## Enable Extended logging

Extended logging of SourceKit-LSP is not enabled by default because it contains information about your source code, directory structure, and similar potentially sensitive information. Instead, the logging system redacts that information. If you are comfortable with sharing such information, you can enable extended SourceKit-LSP’s extended logging, which improves the ability of SourceKit-LSP developers to understand and fix issues.

### macOS

To enable extended logging on macOS, install the configuration profile from https://github.com/swiftlang/sourcekit-lsp/blob/main/Documentation/Enable%20Extended%20Logging.mobileconfig as described in https://support.apple.com/guide/mac-help/configuration-profiles-standardize-settings-mh35561/mac#mchlp41bd550. SourceKit-LSP will immediately stop redacting information and include them in the system log.

To disable extended logging again, remove the configuration profile as described in https://support.apple.com/guide/mac-help/configuration-profiles-standardize-settings-mh35561/mac#mchlpa04df41.

### Non-Apple platforms

To enable extended logging on non-Apple platforms, create a [configuration file](Configuration%20File.md) with the following contents at `~/.sourcekit-lsp/config.json` with the following contents:
```json
{
"logging": {
"level": "debug",
"privacyLevel": "private"
}
}
```
23 changes: 23 additions & 0 deletions Documentation/Enable Extended Logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Enable Extended logging

By default, SourceKit-LSP redacts information about your source code, directory structure, and similar potentially sensitive information from its logs. If you are comfortable with sharing such information, you can enable extended SourceKit-LSP’s extended logging, which improves the ability of SourceKit-LSP developers to understand and fix issues.

When extended logging is enabled, it will log extended information from that point onwards. To capture the extended logs for an issue you are seeing, please reproduce the issue after enabling extended logging and capture a diagnose bundle by running `sourcekit-lsp diagnose` in terminal.

## macOS

To enable extended logging on macOS, install the configuration profile from https://github.com/swiftlang/sourcekit-lsp/blob/main/Documentation/Enable%20Extended%20Logging.mobileconfig as described in https://support.apple.com/guide/mac-help/configuration-profiles-standardize-settings-mh35561/mac#mchlp41bd550. SourceKit-LSP will immediately stop redacting information and include them in the system log.

To disable extended logging again, remove the configuration profile as described in https://support.apple.com/guide/mac-help/configuration-profiles-standardize-settings-mh35561/mac#mchlpa04df41.

## Non-Apple platforms

To enable extended logging on non-Apple platforms, create a [configuration file](Configuration%20File.md) with the following contents at `~/.sourcekit-lsp/config.json` with the following contents:
```json
{
"logging": {
"level": "debug",
"privacyLevel": "private"
}
}
```
2 changes: 1 addition & 1 deletion Documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ The following documentation documents are intended for users of SourceKit-LSP.
- [Diagnose Bundle](Diagnose%20Bundle.md)
- [Editor Integration](Editor%20Integration.md)
- [Enable Experimental Background Indexing](Enable%20Experimental%20Background%20Indexing.md)
- [Environment Variables](Environment%20Variables.md)
- [Enable Extended Logging](Enable%20Extended%20Logging.md)
- [Using SourceKit-LSP with Embedded Projects](Using%20SourceKit-LSP%20with%20Embedded%20Projects.md)