server: Make ErrorLog an interface

This commit is contained in:
Adnan Maolood 2021-02-23 11:10:30 -05:00
parent 4e25d2c3f9
commit f722747abd

View File

@ -46,7 +46,9 @@ type Server struct {
// ErrorLog specifies an optional logger for errors accepting connections,
// unexpected behavior from handlers, and underlying file system errors.
// If nil, logging is done via the log package's standard logger.
ErrorLog *log.Logger
ErrorLog interface {
Printf(format string, v ...interface{})
}
listeners map[*net.Listener]context.CancelFunc
conns map[*net.Conn]context.CancelFunc