package graph import ( "fmt" neo4jLog "github.com/neo4j/neo4j-go-driver/v5/neo4j/log" log "github.com/sirupsen/logrus" ) type graphLogger struct { graphDebug bool } func NewGraphLogger(graphDebug bool) neo4jLog.Logger { return &graphLogger{graphDebug: graphDebug} } func (n graphLogger) Error(name string, id string, err error) { log.WithFields(log.Fields{ "name": name, "id": id, }).Errorf("database: %s", err) } func (n graphLogger) Warnf(name string, id string, msg string, args ...any) { log.WithFields(log.Fields{ "name": name, "id": id, }).Warnf("database: %v", fmt.Sprintf(msg, args...)) } func (n graphLogger) Infof(name string, id string, msg string, args ...any) { log.WithFields(log.Fields{ "name": name, "id": id, }).Infof("database: %v", fmt.Sprintf(msg, args...)) } func (n graphLogger) Debugf(name string, id string, msg string, args ...any) { if n.graphDebug { log.WithFields(log.Fields{ "name": name, "id": id, }).Debugf("database: %v", fmt.Sprintf(msg, args...)) } }