Skip to content

Commit 26e8cce

Browse files
committed
Use proper OSLog privacy levels
1 parent 364147b commit 26e8cce

File tree

9 files changed

+26
-26
lines changed

9 files changed

+26
-26
lines changed

Sources/SourceKitBazelBSP/RequestHandlers/BuildTargets/BazelTargetQuerier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ final class BazelTargetQuerier {
8181
let depsQuery = Self.queryDepsString(forTargets: config.targets)
8282
let cacheKey = "\(kindsFilter)+\(depsQuery)"
8383

84-
logger.info("Processing query request for \(cacheKey, privacy: .public)")
84+
logger.info("Processing query request for \(cacheKey)")
8585

8686
if let cached = queryCache[cacheKey] {
8787
logger.debug("Returning cached results")

Sources/SourceKitBazelBSP/RequestHandlers/BuildTargets/BuildTargetsHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ final class BuildTargetsHandler {
5050
)
5151
do {
5252
let result = try targetStore.fetchTargets()
53-
logger.debug("Found \(result.count, privacy: .public) targets")
53+
logger.debug("Found \(result.count) targets")
5454
connection?.finishTask(id: taskId, status: .ok)
5555
return WorkspaceBuildTargetsResponse(targets: result)
5656
} catch {

Sources/SourceKitBazelBSP/RequestHandlers/InitializeHandler.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ final class InitializeHandler {
8888
baseConfig: BaseServerConfig,
8989
) throws -> InitializedServerConfig {
9090
let rootUri = request.rootUri.arbitrarySchemeURL.path
91-
logger.debug("rootUri: \(rootUri, privacy: .public)")
91+
logger.debug("rootUri: \(rootUri)")
9292
let regularOutputBase = URL(
9393
fileURLWithPath: try commandRunner.bazel(
9494
baseConfig: baseConfig,
9595
rootUri: rootUri,
9696
cmd: "info output_base"
9797
)
9898
)
99-
logger.debug("regularOutputBase: \(regularOutputBase, privacy: .public)")
99+
logger.debug("regularOutputBase: \(regularOutputBase)")
100100

101101
// Setup the special output base path where we will run indexing commands from.
102102
let regularOutputBaseLastPath = regularOutputBase.lastPathComponent
@@ -105,7 +105,7 @@ final class InitializeHandler {
105105
.deletingLastPathComponent()
106106
.appendingPathComponent("\(regularOutputBaseLastPath)-sourcekit-bazel-bsp")
107107
.path
108-
logger.debug("outputBase: \(outputBase, privacy: .public)")
108+
logger.debug("outputBase: \(outputBase)")
109109

110110
// Now, get the full output path based on the above output base.
111111
let outputPath = try commandRunner.bazelIndexAction(
@@ -114,16 +114,16 @@ final class InitializeHandler {
114114
cmd: "info output_path",
115115
rootUri: rootUri
116116
)
117-
logger.debug("outputPath: \(outputPath, privacy: .public)")
117+
logger.debug("outputPath: \(outputPath)")
118118

119119
// Collecting the rest of the env's details
120120
let devDir = try commandRunner.run("xcode-select --print-path")
121121
let sdkRoot = try commandRunner.run("xcrun --sdk iphonesimulator --show-sdk-path")
122122
let toolchain = try getToolchainPath(with: commandRunner)
123123

124-
logger.debug("devDir: \(devDir, privacy: .public)")
125-
logger.debug("sdkRoot: \(sdkRoot, privacy: .public)")
126-
logger.debug("toolchain: \(toolchain, privacy: .public)")
124+
logger.debug("devDir: \(devDir)")
125+
logger.debug("sdkRoot: \(sdkRoot)")
126+
logger.debug("toolchain: \(toolchain)")
127127

128128
return InitializedServerConfig(
129129
baseConfig: baseConfig,

Sources/SourceKitBazelBSP/RequestHandlers/PrepareHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ final class PrepareHandler {
7777
func build(
7878
bazelLabels labelsToBuild: [String]
7979
) throws {
80-
logger.info("Will build \(labelsToBuild.count, privacy: .public) targets")
80+
logger.info("Will build \(labelsToBuild.count) targets")
8181

8282
// Build the provided targets, on our special output base and taking into account special index flags.
8383
_ = try commandRunner.bazelIndexAction(

Sources/SourceKitBazelBSP/RequestHandlers/SKOptions/SKOptionsHandler.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ final class SKOptionsHandler {
8282
}
8383
let targetUri = request.target.uri
8484
logger.info(
85-
"Getting SKOptions for \(targetUri.stringValue, privacy: .public), language: \(request.language, privacy: .public)"
85+
"Getting SKOptions for \(targetUri.stringValue), language: \(request.language)"
8686
)
8787
let bazelTarget = try targetStore.bazelTargetLabel(forBSPURI: targetUri)
88-
logger.info("Target is: \(bazelTarget, privacy: .public)")
88+
logger.info("Target is: \(bazelTarget)")
8989
let args = try getCompilerArguments(
9090
bazelTarget,
9191
request.language,
@@ -121,10 +121,10 @@ final class SKOptionsHandler {
121121
contentToQuery = parsedFile
122122
}
123123
if let cachedArgs = queryCache[cacheKey] {
124-
logger.info("Returning cached compiler arguments for \(cacheKey, privacy: .public)")
124+
logger.info("Returning cached compiler arguments for \(cacheKey)")
125125
return cachedArgs
126126
}
127-
logger.info("Getting compiler arguments for \(cacheKey, privacy: .public)")
127+
logger.info("Getting compiler arguments for \(cacheKey)")
128128
let appToBuild = BazelTargetQuerier.queryDepsString(
129129
forTargets: initializedConfig.baseConfig.targets)
130130
var output: String
@@ -184,10 +184,10 @@ final class SKOptionsHandler {
184184
}
185185
if idx == -1 {
186186
logger.error(
187-
"No module entry found in the aquery for \(contentToQuery, privacy: .public)")
187+
"No module entry found in the aquery for \(contentToQuery)")
188188
return []
189189
}
190-
logger.info("Found module for \(bazelTarget, privacy: .public) at \(idx, privacy: .public)")
190+
logger.info("Found module for \(bazelTarget) at \(idx)")
191191
// now, get the first index of the line that starts with "Command Line: ("
192192
lines = Array(lines.dropFirst(idx + 1))
193193
idx = -1
@@ -205,7 +205,7 @@ final class SKOptionsHandler {
205205
logger.error("No command line entry found")
206206
return []
207207
}
208-
logger.info("Found command line entry at \(idx, privacy: .public)")
208+
logger.info("Found command line entry at \(idx)")
209209

210210
// now, find where the arguments end
211211
lines = Array(lines.dropFirst(idx + 1))
@@ -222,7 +222,7 @@ final class SKOptionsHandler {
222222
return []
223223
}
224224

225-
logger.info("Found where the args end at \(idx, privacy: .public)")
225+
logger.info("Found where the args end at \(idx)")
226226
lines = Array(lines.dropLast(lines.count - idx - 1))
227227

228228
// the spaced lines are the compiler arguments

Sources/SourceKitBazelBSP/RequestHandlers/TargetSourcesHandler.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ final class TargetSourcesHandler {
4444
_ id: RequestID
4545
) throws -> BuildTargetSourcesResponse {
4646
let targets = request.targets
47-
logger.info("Fetching sources for \(targets.count, privacy: .public) targets")
47+
logger.info("Fetching sources for \(targets.count) targets")
4848

4949
var srcs: [SourcesItem] = []
5050
for target in targets {
@@ -61,7 +61,7 @@ final class TargetSourcesHandler {
6161
let count = srcs.reduce(0) { $0 + $1.sources.count }
6262

6363
logger.info(
64-
"Returning \(srcs.count, privacy: .public) source specs (\(count, privacy: .public) total source entries)"
64+
"Returning \(srcs.count) source specs (\(count) total source entries)"
6565
)
6666

6767
return BuildTargetSourcesResponse(items: srcs)

Sources/SourceKitBazelBSP/Server/MessageHandler/BSPMessageHandler.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ final class BSPMessageHandler: MessageHandler {
6262
func handle<Notification: NotificationType>(_ notification: Notification) {
6363
lock.withLockUnchecked {
6464
logger.info(
65-
"Received notification: \(Notification.method, privacy: .public)"
65+
"Received notification: \(Notification.method)"
6666
)
6767
do {
6868
let handler = try getHandler(for: notification, state: state)
@@ -80,12 +80,12 @@ final class BSPMessageHandler: MessageHandler {
8080
) {
8181
lock.withLockUnchecked {
8282
logger.info(
83-
"Received request: \(Request.method, privacy: .public)"
83+
"Received request: \(Request.method)"
8484
)
8585
do {
8686
let handler = try getHandler(for: request, id, reply, state: state)
8787
let response = try handler(request, id)
88-
logger.info("Replying to \(Request.method, privacy: .public)")
88+
logger.info("Replying to \(Request.method)")
8989
reply(.success(response))
9090
} catch {
9191
logger.error("Error while handling BSP request: \(error.localizedDescription)")

Sources/SourceKitBazelBSP/SharedUtils/Shell/ShellCommandRunner.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct ShellCommandRunner: CommandRunner {
4848
task.arguments = ["-c", cmd]
4949
task.standardInput = nil
5050

51-
logger.info("Running shell: \(cmd, privacy: .public)")
51+
logger.info("Running shell: \(cmd)")
5252
try task.run()
5353

5454
// Drain stdout/err first to avoid deadlocking when the output is buffered.

Sources/SourceKitBazelBSP/SharedUtils/SplitLogMessage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ extension Logger {
6161
self.log(
6262
level: level,
6363
"""
64-
\(header, privacy: .public) (\(i + 1)/\(maxChunkCount))
65-
\(loggableChunk, privacy: .public)
64+
\(header) (\(i + 1)/\(maxChunkCount))
65+
\(loggableChunk)
6666
"""
6767
)
6868
}

0 commit comments

Comments
 (0)