mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-08-05 20:58:28 +02:00

- Replaced all log.Println in acme module to system wide logger - Fixed file manager path escape bug #274
25 lines
548 B
Go
25 lines
548 B
Go
package cproxy
|
|
|
|
type loggingInitializer struct {
|
|
logger logger
|
|
inner initializer
|
|
}
|
|
|
|
func newLoggingInitializer(config *configuration) initializer {
|
|
if !config.LogConnections {
|
|
return config.Initializer
|
|
}
|
|
|
|
return &loggingInitializer{inner: config.Initializer, logger: config.Logger}
|
|
}
|
|
|
|
func (this *loggingInitializer) Initialize(client, server Socket) bool {
|
|
result := this.inner.Initialize(client, server)
|
|
|
|
if !result {
|
|
this.logger.Printf("Connection failed [%s] -> [%s]", client.RemoteAddr(), server.RemoteAddr())
|
|
}
|
|
|
|
return result
|
|
}
|