From c3305139d4ba3b2a7aad33da262301175911abdb Mon Sep 17 00:00:00 2001 From: Sebastian Tobie Date: Sat, 27 Feb 2021 00:35:00 +0100 Subject: [PATCH] changed the Config class to support the new interface to log objects --- http.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/http.go b/http.go index 1277d59..dde7f06 100644 --- a/http.go +++ b/http.go @@ -20,11 +20,13 @@ type Config struct { Keyfile string } -// MarshalLogObject adds the information over the object to the *log.Entry -func (c *Config) MarshalLogObject(e *log.Entry) { +// MarshalObject adds the information over the object to the *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}) } +var _ log.ObjectMarshaler = &Config{} + // Server is an wrapper for the *http.Server and *gin.Engine type Server struct { http *http.Server