1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-28 16:06:40 +01:00

chore: uses zerolog instead of logrus (#3203)

This commit is contained in:
Amir Raminfar
2024-08-14 10:04:18 -07:00
committed by GitHub
parent 37f0249065
commit 077eeb7917
38 changed files with 278 additions and 265 deletions

View File

@@ -5,17 +5,16 @@ import (
"embed"
"os"
log "github.com/sirupsen/logrus"
"github.com/rs/zerolog/log"
)
func ReadCertificates(certs embed.FS) (tls.Certificate, error) {
if pair, err := tls.LoadX509KeyPair("dozzle_cert.pem", "dozzle_key.pem"); err == nil {
log.Infof("Found dozzle certificate and key at ./dozzle_cert.pem and ./dozzle_key.pem")
log.Info().Msg("Loaded custom dozzle certificate and key")
return pair, nil
} else {
if !os.IsNotExist(err) {
log.Errorf("Failed to load dozzle certificate and key: %v", err)
log.Warnf("Falling back to shared certificate and key")
log.Fatal().Err(err).Msg("Failed to load custom dozzle certificate and key. Stopping...")
}
}