1
0
Fork 0

changed the Config class to support the new interface to log objects

Dieser Commit ist enthalten in:
Sebastian Tobie 2021-02-27 00:35:00 +01:00
Ursprung 9e63f58de6
Commit c3305139d4
1 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -20,11 +20,13 @@ type Config struct {
Keyfile string Keyfile string
} }
// MarshalLogObject adds the information over the object to the *log.Entry // MarshalObject adds the information over the object to the *log.Entry
func (c *Config) MarshalLogObject(e *log.Entry) { func (c *Config) MarshalObject(e *log.Entry) {
e.Str("Address", c.Addr).Bool("TLS", c.TLSconfig != nil).Strs("Cert", []string{c.Certfile, c.Keyfile}) e.Str("Address", c.Addr).Bool("TLS", c.TLSconfig != nil).Strs("Cert", []string{c.Certfile, c.Keyfile})
} }
var _ log.ObjectMarshaler = &Config{}
// Server is an wrapper for the *http.Server and *gin.Engine // Server is an wrapper for the *http.Server and *gin.Engine
type Server struct { type Server struct {
http *http.Server http *http.Server