From 200bb7b924af70ca4a0c4c673e49e0412d07e989 Mon Sep 17 00:00:00 2001 From: Johan Brandhorst Date: Thu, 26 Sep 2019 14:32:48 +0100 Subject: [PATCH] Remove excessive logging Fixes #82 --- certify.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/certify.go b/certify.go index ecf6d5d..b3f1919 100644 --- a/certify.go +++ b/certify.go @@ -69,23 +69,13 @@ func (c *Certify) init() { // GetCertificate implements the GetCertificate TLS config hook. func (c *Certify) GetCertificate(hello *tls.ClientHelloInfo) (cert *tls.Certificate, err error) { c.initOnce.Do(c.init) - start := time.Now() - c.Logger.Debug("Getting server certificate", map[string]interface{}{ - "server_name": hello.ServerName, - "remote_addr": hello.Conn.RemoteAddr().String(), - }) defer func() { - took := time.Since(start) if err != nil { c.Logger.Error("Error getting server certificate", map[string]interface{}{ "error": err.Error(), }) return } - c.Logger.Debug("Certificate found", map[string]interface{}{ - "serial": cert.Leaf.SerialNumber.String(), - "took": took.String(), - }) }() name := strings.ToLower(hello.ServerName) @@ -110,20 +100,13 @@ func (c *Certify) GetCertificate(hello *tls.ClientHelloInfo) (cert *tls.Certific // GetClientCertificate implements the GetClientCertificate TLS config hook. func (c *Certify) GetClientCertificate(_ *tls.CertificateRequestInfo) (cert *tls.Certificate, err error) { c.initOnce.Do(c.init) - start := time.Now() - c.Logger.Debug("Getting client certificate") defer func() { - took := time.Since(start) if err != nil { c.Logger.Error("Error getting client certificate", map[string]interface{}{ "error": err.Error(), }) return } - c.Logger.Debug("Certificate found", map[string]interface{}{ - "serial": cert.Leaf.SerialNumber.String(), - "took": took.String(), - }) }() return c.getOrRenewCert(c.CommonName) }