Implement custom logger with log levels

This commit is contained in:
Pijus Kamandulis
2024-02-27 22:38:59 +02:00
parent b9e38575bc
commit 6ccb7c4bdd
13 changed files with 108 additions and 51 deletions

View File

@@ -0,0 +1,19 @@
package tlsprovider
import (
"crypto/tls"
"github.com/pikami/cosmium/internal/logger"
)
func GetDefaultTlsConfig() *tls.Config {
cert, err := tls.X509KeyPair([]byte(certificate), []byte(certificateKey))
if err != nil {
logger.Error("Failed to parse certificate and key:", err)
return &tls.Config{}
}
return &tls.Config{
Certificates: []tls.Certificate{cert},
}
}