fix logs not printing correctly, removed unneccessary loggers

This commit is contained in:
yusing
2025-01-20 17:42:54 +08:00
parent 64e85c3076
commit dd0bbdc7b4
38 changed files with 130 additions and 150 deletions

View File

@@ -4,6 +4,7 @@ import (
"os"
E "github.com/yusing/go-proxy/internal/error"
"github.com/yusing/go-proxy/internal/logging"
"github.com/yusing/go-proxy/internal/utils/strutils"
)
@@ -12,14 +13,14 @@ func (p *Provider) Setup() (err E.Error) {
if !err.Is(os.ErrNotExist) { // ignore if cert doesn't exist
return err
}
logger.Debug().Msg("obtaining cert due to error loading cert")
logging.Debug().Msg("obtaining cert due to error loading cert")
if err = p.ObtainCert(); err != nil {
return err
}
}
for _, expiry := range p.GetExpiries() {
logger.Info().Msg("certificate expire on " + strutils.FormatTime(expiry))
logging.Info().Msg("certificate expire on " + strutils.FormatTime(expiry))
break
}