@@ -11,12 +11,12 @@ import OSLog
1111import Pulse
1212#endif
1313
14- public protocol RemoteLoggerConnectionDelegate : AnyObject {
14+ protocol RemoteLoggerConnectionDelegate : AnyObject {
1515 func connection( _ connection: RemoteLogger . Connection , didChangeState newState: NWConnection . State )
1616 func connection( _ connection: RemoteLogger . Connection , didReceiveEvent event: RemoteLogger . Connection . Event )
1717}
1818
19- public extension RemoteLogger {
19+ extension RemoteLogger {
2020 final class Connection {
2121 var endpoint : NWEndpoint { connection. endpoint }
2222 private let connection : NWConnection
@@ -31,15 +31,15 @@ public extension RemoteLogger {
3131 self . init ( NWConnection ( to: endpoint, using: parameters) )
3232 }
3333
34- public init ( _ connection: NWConnection , delegate: RemoteLoggerConnectionDelegate ? = nil ) {
34+ init ( _ connection: NWConnection , delegate: RemoteLoggerConnectionDelegate ? = nil ) {
3535 self . connection = connection
3636 self . delegate = delegate
3737
3838 let isLogEnabled = UserDefaults . standard. bool ( forKey: " com.github.kean.pulse.debug " )
3939 self . log = isLogEnabled ? OSLog ( subsystem: " com.github.kean.pulse " , category: " RemoteLogger " ) : . disabled
4040 }
4141
42- public func start( on queue: DispatchQueue ) {
42+ func start( on queue: DispatchQueue ) {
4343 connection. stateUpdateHandler = { [ weak self] state in
4444 guard let self = self else { return }
4545 DispatchQueue . main. async {
@@ -50,15 +50,15 @@ public extension RemoteLogger {
5050 connection. start ( queue: queue)
5151 }
5252
53- public enum Event {
53+ enum Event {
5454 case packet( Packet )
5555 case error( Error )
5656 case completed
5757 }
5858
59- public struct Packet {
60- public let code : UInt8
61- public let body : Data
59+ struct Packet {
60+ let code : UInt8
61+ let body : Data
6262 }
6363
6464 private func receive( ) {
@@ -131,7 +131,7 @@ public extension RemoteLogger {
131131 }
132132 }
133133
134- public func send( code: UInt8 , data: Data ) {
134+ func send( code: UInt8 , data: Data ) {
135135 do {
136136 let data = try encode ( code: code, body: data)
137137 let log = self . log
@@ -145,7 +145,7 @@ public extension RemoteLogger {
145145 }
146146 }
147147
148- public func send< T: Encodable > ( code: UInt8 , entity: T ) {
148+ func send< T: Encodable > ( code: UInt8 , entity: T ) {
149149 do {
150150 let data = try JSONEncoder ( ) . encode ( entity)
151151 send ( code: code, data: data)
@@ -207,7 +207,7 @@ public extension RemoteLogger {
207207 }
208208 }
209209
210- public func cancel( ) {
210+ func cancel( ) {
211211 connection. cancel ( )
212212 }
213213 }
0 commit comments