1010//
1111//===----------------------------------------------------------------------===//
1212
13- @_spi ( SourceKitLSP) public import ToolsProtocolsSwiftExtensions
13+ @_spi ( SourceKitLSP) import ToolsProtocolsSwiftExtensions
1414
1515#if canImport(Darwin)
1616import Foundation
@@ -23,7 +23,7 @@ import Foundation
2323
2424@_spi ( SourceKitLSP) public enum LogConfig {
2525 /// The globally set log level
26- @ _spi ( SourceKitLSP ) public static let logLevel = ThreadSafeBox < NonDarwinLogLevel > (
26+ private static let _logLevel = ThreadSafeBox < NonDarwinLogLevel > (
2727 initialValue: {
2828 if let envVar = ProcessInfo . processInfo. environment [ " SOURCEKIT_LSP_LOG_LEVEL " ] ,
2929 let logLevel = NonDarwinLogLevel ( envVar)
@@ -38,8 +38,17 @@ import Foundation
3838 } ( )
3939 )
4040
41+ @_spi ( SourceKitLSP) public static var logLevel : NonDarwinLogLevel {
42+ get {
43+ _logLevel. value
44+ }
45+ set {
46+ _logLevel. value = newValue
47+ }
48+ }
49+
4150 /// The globally set privacy level
42- @ _spi ( SourceKitLSP ) public static let privacyLevel = ThreadSafeBox < NonDarwinLogPrivacy > (
51+ private static let _privacyLevel = ThreadSafeBox < NonDarwinLogPrivacy > (
4352 initialValue: {
4453 if let envVar = ProcessInfo . processInfo. environment [ " SOURCEKIT_LSP_LOG_PRIVACY_LEVEL " ] ,
4554 let privacyLevel = NonDarwinLogPrivacy ( envVar)
@@ -53,6 +62,15 @@ import Foundation
5362 #endif
5463 } ( )
5564 )
65+
66+ @_spi ( SourceKitLSP) public static var privacyLevel : NonDarwinLogPrivacy {
67+ get {
68+ _privacyLevel. value
69+ }
70+ set {
71+ _privacyLevel. value = newValue
72+ }
73+ }
5674}
5775
5876/// A type that is API-compatible to `OSLogType` for all uses within
@@ -302,7 +320,7 @@ private let loggingQueue = AsyncQueue<Serial>()
302320/// not available.
303321///
304322/// `overrideLogHandler` allows capturing of the logged messages for testing purposes.
305- @ _spi ( SourceKitLSP ) public struct NonDarwinLogger : Sendable {
323+ public struct NonDarwinLogger : Sendable {
306324 private let subsystem : String
307325 private let category : String
308326 private let logLevel : NonDarwinLogLevel
@@ -326,8 +344,8 @@ private let loggingQueue = AsyncQueue<Serial>()
326344 ) {
327345 self . subsystem = subsystem
328346 self . category = category
329- self . logLevel = logLevel ?? LogConfig . logLevel. value
330- self . privacyLevel = privacyLevel ?? LogConfig . privacyLevel. value
347+ self . logLevel = logLevel ?? LogConfig . logLevel
348+ self . privacyLevel = privacyLevel ?? LogConfig . privacyLevel
331349 self . overrideLogHandler = overrideLogHandler
332350 }
333351
0 commit comments