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