mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-27 22:15:00 +00:00
feat: first pass at improving logging (#1956)
Signed-off-by: Chris Jowett <421501+cryptk@users.noreply.github.com>
This commit is contained in:
parent
3851b51d98
commit
b85dad0286
13 changed files with 53 additions and 43 deletions
|
@ -15,8 +15,8 @@ import (
|
|||
)
|
||||
|
||||
var Aliases map[string]string = map[string]string{
|
||||
"go-llama": LLamaCPP,
|
||||
"llama": LLamaCPP,
|
||||
"go-llama": LLamaCPP,
|
||||
"llama": LLamaCPP,
|
||||
"embedded-store": LocalStoreBackend,
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ func (ml *ModelLoader) grpcModel(backend string, o *Options) func(string, string
|
|||
break
|
||||
}
|
||||
if err != nil && i == o.grpcAttempts-1 {
|
||||
log.Error().Msgf("Failed starting/connecting to the gRPC service: %s", err.Error())
|
||||
log.Error().Err(err).Msg("failed starting/connecting to the gRPC service")
|
||||
}
|
||||
time.Sleep(time.Duration(o.grpcAttemptsDelay) * time.Second)
|
||||
}
|
||||
|
|
|
@ -110,10 +110,10 @@ func (wd *WatchDog) checkIdle() {
|
|||
log.Debug().Msgf("[WatchDog] %s: idle connection", address)
|
||||
if time.Since(t) > wd.idletimeout {
|
||||
log.Warn().Msgf("[WatchDog] Address %s is idle for too long, killing it", address)
|
||||
p, ok := wd.addressModelMap[address]
|
||||
model, ok := wd.addressModelMap[address]
|
||||
if ok {
|
||||
if err := wd.pm.ShutdownModel(p); err != nil {
|
||||
log.Error().Msgf("[watchdog] Error shutting down model %s: %v", p, err)
|
||||
if err := wd.pm.ShutdownModel(model); err != nil {
|
||||
log.Error().Err(err).Str("model", model).Msg("[watchdog] error shutting down model")
|
||||
}
|
||||
log.Debug().Msgf("[WatchDog] model shut down: %s", address)
|
||||
delete(wd.idleTime, address)
|
||||
|
@ -141,7 +141,7 @@ func (wd *WatchDog) checkBusy() {
|
|||
if ok {
|
||||
log.Warn().Msgf("[WatchDog] Model %s is busy for too long, killing it", model)
|
||||
if err := wd.pm.ShutdownModel(model); err != nil {
|
||||
log.Error().Msgf("[watchdog] Error shutting down model %s: %v", model, err)
|
||||
log.Error().Err(err).Str("model", model).Msg("[watchdog] error shutting down model")
|
||||
}
|
||||
log.Debug().Msgf("[WatchDog] model shut down: %s", address)
|
||||
delete(wd.timetable, address)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue