Skip to content

Commit eece97a

Browse files
committed
Add a configuration profile to enable extended logging in SourceKit-LSP
A configuration profile is needed to enable extended logging, ie to disable redacting possibly private information. Add documentation about when and how to install it.
1 parent 82e54ef commit eece97a

File tree

2 files changed

+75
-1
lines changed

2 files changed

+75
-1
lines changed

Diff for: Documentation/Diagnose Bundle.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,19 @@ The diagnose bundle contains the following information:
77
- From Xcode toolchains, just a stack trace.
88
- For assert compilers (ie. nightly toolchains) also sometimes some source code that was currently compiled to cause the crash.
99
- Log messages emitted by SourceKit
10-
- We mark all information that may contain private information (source code, file names, …) as private in os_log so by default all of that will be redacted. Private logging can be enabled for SourceKit-LSP on macOS by running `sudo log config --subsystem org.swift.sourcekit-lsp --mode private_data:on`. These log messages are also included in a sysdiagnose.
10+
- We mark all information that may contain private information (source code, file names, …) as private in os_log so by default all of that will be redacted. Private logging can be enabled for SourceKit-LSP as described in [Enable Extended Logging](#enable-extended-logging). These extended log messages are also included in a sysdiagnose.
1111
- On Linux and Windows, we currently don’t redact the private information, so users should always explicitly be asked before sharing these logs.
1212
- Versions of Swift installed on your system
1313
- We don’t consider this private information
1414
- If possible, a minimized project that caused SourceKit to crash
1515
- If possible, a minimized project that caused the Swift compiler to crash
1616
- Both minimized projects contain user code and are thus considered private. Hence we need to explicitly prompt the user before sharing this information.
1717
- As a future direction, it could be possible to remove any private information from the reduced examples by removing all comments and replacing all identifiers by obfuscated names.
18+
19+
## Enable Extended logging
20+
21+
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.
22+
23+
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.
24+
25+
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.

Diff for: Documentation/Enable Extended Logging.mobileconfig

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>PayloadContent</key>
6+
<array>
7+
<dict>
8+
<key>PayloadDisplayName</key>
9+
<string>Enable Extended Logging</string>
10+
<key>PayloadEnabled</key>
11+
<true/>
12+
<key>PayloadIdentifier</key>
13+
<string>com.apple.system.logging.C6E6C174-6B72-42FE-AF4D-2EBEB7080F6A</string>
14+
<key>PayloadType</key>
15+
<string>com.apple.system.logging</string>
16+
<key>PayloadUUID</key>
17+
<string>C6E6C174-6B72-42FE-AF4D-2EBEB7080F6A</string>
18+
<key>PayloadVersion</key>
19+
<integer>1</integer>
20+
<key>Subsystems</key>
21+
<dict>
22+
<key>org.swift.sourcekit-lsp</key>
23+
<dict>
24+
<key>DEFAULT-OPTIONS</key>
25+
<dict>
26+
<key>Enable-Private-Data</key>
27+
<true/>
28+
</dict>
29+
</dict>
30+
<key>org.swift.sourcekit-lsp.indexing</key>
31+
<dict>
32+
<key>DEFAULT-OPTIONS</key>
33+
<dict>
34+
<key>Enable-Private-Data</key>
35+
<true/>
36+
</dict>
37+
</dict>
38+
<key>org.swift.sourcekit-lsp.task-scheduler</key>
39+
<dict>
40+
<key>DEFAULT-OPTIONS</key>
41+
<dict>
42+
<key>Enable-Private-Data</key>
43+
<true/>
44+
</dict>
45+
</dict>
46+
</dict>
47+
</dict>
48+
</array>
49+
<key>PayloadDescription</key>
50+
<string>Enables extended logging from SourceKit-LSP, which is not enabled by default because it contains information about your source code, directory structure and similar potentially sensitive information.</string>
51+
<key>PayloadDisplayName</key>
52+
<string>Extended SourceKit-LSP Logging</string>
53+
<key>PayloadIdentifier</key>
54+
<string>org.swift.sourcekit-lsp.enable-extended-logging</string>
55+
<key>PayloadRemovalDisallowed</key>
56+
<false/>
57+
<key>PayloadScope</key>
58+
<string>System</string>
59+
<key>PayloadType</key>
60+
<string>Configuration</string>
61+
<key>PayloadUUID</key>
62+
<string>AB0B405D-E807-4BFA-8D83-765A8AAC6EC7</string>
63+
<key>PayloadVersion</key>
64+
<integer>1</integer>
65+
</dict>
66+
</plist>

0 commit comments

Comments
 (0)