log: improve logging

- add a panic recovery handler
        - add logs on unexpected error paths
        - use logger's panic method
This commit is contained in:
Ramkumar Chinchani
2019-11-25 14:33:58 -08:00
parent 3e7ca9c517
commit 9ae9e40b67
13 changed files with 75 additions and 25 deletions
+2 -2
View File
@@ -2,9 +2,9 @@ package api
import (
"github.com/anuvu/zot/errors"
"github.com/anuvu/zot/pkg/log"
"github.com/getlantern/deepcopy"
dspec "github.com/opencontainers/distribution-spec"
"github.com/rs/zerolog"
)
//nolint (gochecknoglobals)
@@ -92,7 +92,7 @@ func (c *Config) Sanitize() *Config {
return c
}
func (c *Config) Validate(log zerolog.Logger) error {
func (c *Config) Validate(log log.Logger) error {
// LDAP configuration
if c.HTTP.Auth != nil && c.HTTP.Auth.LDAP != nil {
l := c.HTTP.Auth.LDAP