Add log messages to error events w/o log message, primaryly error level

- "log spam" to be controlled via loglevel flag on startup
This commit is contained in:
Christoph Kluge
2023-01-31 18:28:44 +01:00
parent 25eb3bb481
commit b77bd078e5
22 changed files with 214 additions and 14 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/ClusterCockpit/cc-backend/pkg/lrucache"
"github.com/ClusterCockpit/cc-backend/pkg/schema"
"github.com/ClusterCockpit/cc-backend/pkg/log"
)
type ArchiveBackend interface {
@@ -40,6 +41,7 @@ func Init(rawConfig json.RawMessage, disableArchive bool) error {
Kind string `json:"kind"`
}
if err := json.Unmarshal(rawConfig, &kind); err != nil {
log.Error("Error while unmarshaling raw config json")
return err
}
@@ -53,6 +55,7 @@ func Init(rawConfig json.RawMessage, disableArchive bool) error {
}
if err := ar.Init(rawConfig); err != nil {
log.Error("Error while initializing archiveBackend")
return err
}
return initClusterConfig()
@@ -70,6 +73,7 @@ func LoadAveragesFromArchive(
metaFile, err := ar.LoadJobMeta(job)
if err != nil {
log.Error("Error while loading job metadata from archiveBackend")
return err
}
@@ -88,6 +92,7 @@ func GetStatistics(job *schema.Job) (map[string]schema.JobStatistics, error) {
metaFile, err := ar.LoadJobMeta(job)
if err != nil {
log.Error("Error while loading job metadata from archiveBackend")
return nil, err
}
@@ -104,6 +109,7 @@ func UpdateTags(job *schema.Job, tags []*schema.Tag) error {
jobMeta, err := ar.LoadJobMeta(job)
if err != nil {
log.Error("Error while loading job metadata from archiveBackend")
return err
}