chore(p2p): enhance logging (#4090)

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2024-11-07 18:09:33 +01:00 committed by GitHub
parent 06d0d00231
commit 20a5b20b59
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 8 deletions

19
core/p2p/p2p_common.go Normal file
View file

@ -0,0 +1,19 @@
package p2p
import (
"os"
"strings"
)
var logLevel = strings.ToLower(os.Getenv("LOCALAI_P2P_LOGLEVEL"))
const (
logLevelDebug = "debug"
logLevelInfo = "info"
)
func init() {
if logLevel == "" {
logLevel = logLevelInfo
}
}