Mask log.debug
This commit is contained in:
parent
033763f372
commit
ae85337e91
|
@ -70,7 +70,7 @@ class ConnectionStrategy {
|
|||
|
||||
// reuse preferred address
|
||||
if let preferredAddress = preferredAddress {
|
||||
log.debug("Pick preferred address: \(preferredAddress)")
|
||||
log.debug("Pick preferred address: \(preferredAddress.maskedDescription)")
|
||||
let socket = provider.createSocket(to: preferredAddress, protocol: currentProtocol())
|
||||
completionHandler(socket, nil)
|
||||
return
|
||||
|
@ -78,21 +78,21 @@ class ConnectionStrategy {
|
|||
|
||||
// use any resolved address
|
||||
if prefersResolvedAddresses, let resolvedAddress = anyResolvedAddress() {
|
||||
log.debug("Pick resolved address: \(resolvedAddress)")
|
||||
log.debug("Pick resolved address: \(resolvedAddress.maskedDescription)")
|
||||
let socket = provider.createSocket(to: resolvedAddress, protocol: currentProtocol())
|
||||
completionHandler(socket, nil)
|
||||
return
|
||||
}
|
||||
|
||||
// fall back to DNS
|
||||
log.debug("DNS resolve hostname: \(hostname)")
|
||||
log.debug("DNS resolve hostname: \(hostname.maskedDescription)")
|
||||
DNSResolver.resolve(hostname, timeout: timeout, queue: queue) { (addresses, error) in
|
||||
|
||||
// refresh resolved addresses
|
||||
if let resolved = addresses, !resolved.isEmpty {
|
||||
self.resolvedAddresses = resolved
|
||||
|
||||
log.debug("DNS resolved addresses: \(resolved)")
|
||||
log.debug("DNS resolved addresses: \(resolved.map { $0.maskedDescription })")
|
||||
} else {
|
||||
log.error("DNS resolution failed!")
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ class InterfaceObserver: NSObject {
|
|||
let currentWifiName = currentWifiNetworkName()
|
||||
if (currentWifiName != lastWifiName) {
|
||||
if let current = currentWifiName {
|
||||
log.debug("SSID is now '\(current)'")
|
||||
log.debug("SSID is now '\(current.maskedDescription)'")
|
||||
if let last = lastWifiName, (current != last) {
|
||||
queue?.async {
|
||||
NotificationCenter.default.post(name: .__InterfaceObserverDidDetectWifiChange, object: nil)
|
||||
|
|
|
@ -137,9 +137,9 @@ class NETCPSocket: NSObject, GenericSocket {
|
|||
switch keyPath {
|
||||
case #keyPath(NWTCPConnection.state):
|
||||
if let resolvedEndpoint = impl.remoteAddress {
|
||||
log.debug("Socket state is \(impl.state) (endpoint: \(impl.endpoint) -> \(resolvedEndpoint))")
|
||||
log.debug("Socket state is \(impl.state) (endpoint: \(impl.endpoint.maskedDescription) -> \(resolvedEndpoint.maskedDescription))")
|
||||
} else {
|
||||
log.debug("Socket state is \(impl.state) (endpoint: \(impl.endpoint) -> in progress)")
|
||||
log.debug("Socket state is \(impl.state) (endpoint: \(impl.endpoint.maskedDescription) -> in progress)")
|
||||
}
|
||||
|
||||
switch impl.state {
|
||||
|
|
|
@ -137,9 +137,9 @@ class NEUDPSocket: NSObject, GenericSocket {
|
|||
switch keyPath {
|
||||
case #keyPath(NWUDPSession.state):
|
||||
if let resolvedEndpoint = impl.resolvedEndpoint {
|
||||
log.debug("Socket state is \(impl.state) (endpoint: \(impl.endpoint) -> \(resolvedEndpoint))")
|
||||
log.debug("Socket state is \(impl.state) (endpoint: \(impl.endpoint.maskedDescription) -> \(resolvedEndpoint.maskedDescription))")
|
||||
} else {
|
||||
log.debug("Socket state is \(impl.state) (endpoint: \(impl.endpoint) -> in progress)")
|
||||
log.debug("Socket state is \(impl.state) (endpoint: \(impl.endpoint.maskedDescription) -> in progress)")
|
||||
}
|
||||
|
||||
switch impl.state {
|
||||
|
|
|
@ -602,7 +602,7 @@ extension TunnelKitProvider {
|
|||
|
||||
private func logCurrentSSID() {
|
||||
if let ssid = observer.currentWifiNetworkName() {
|
||||
log.debug("Current SSID: '\(ssid)'")
|
||||
log.debug("Current SSID: '\(ssid.maskedDescription)'")
|
||||
} else {
|
||||
log.debug("Current SSID: none (disconnected from WiFi)")
|
||||
}
|
||||
|
|
|
@ -856,7 +856,7 @@ public class SessionProxy {
|
|||
return
|
||||
}
|
||||
reply = optionalReply
|
||||
log.debug("Received PUSH_REPLY: \"\(reply)\"")
|
||||
log.debug("Received PUSH_REPLY: \"\(reply.maskedDescription)\"")
|
||||
} catch let e {
|
||||
deferStop(.shutdown, e)
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue