1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-11-23 12:02:58 -05:00

lazy evaluation of log fields

This commit is contained in:
v2ray
2016-01-18 12:24:33 +01:00
parent 8f20933457
commit eec0bb4db4
25 changed files with 124 additions and 117 deletions

View File

@@ -74,7 +74,7 @@ func (this *DokodemoDoor) ListenUDP(port v2net.Port) error {
Zone: "",
})
if err != nil {
log.Error("Dokodemo failed to listen on port %d: %v", port, err)
log.Error("Dokodemo failed to listen on port ", port, ": ", err)
return err
}
this.udpMutex.Lock()
@@ -97,7 +97,7 @@ func (this *DokodemoDoor) handleUDPPackets() {
buffer.Slice(0, nBytes)
if err != nil {
buffer.Release()
log.Error("Dokodemo failed to read from UDP: %v", err)
log.Error("Dokodemo failed to read from UDP: ", err)
return
}
@@ -124,7 +124,7 @@ func (this *DokodemoDoor) ListenTCP(port v2net.Port) error {
Zone: "",
})
if err != nil {
log.Error("Dokodemo failed to listen on port %d: %v", port, err)
log.Error("Dokodemo failed to listen on port ", port, ": ", err)
return err
}
this.tcpMutex.Lock()
@@ -144,7 +144,7 @@ func (this *DokodemoDoor) AcceptTCPConnections() {
}
connection, err := this.tcpListener.AcceptTCP()
if err != nil {
log.Error("Dokodemo failed to accept new connections: %v", err)
log.Error("Dokodemo failed to accept new connections: ", err)
return err
}
go this.HandleTCPConnection(connection)