diff --git a/central_auth_key_handling.go b/central_auth_key_handling.go index 51056f3..58b2658 100644 --- a/central_auth_key_handling.go +++ b/central_auth_key_handling.go @@ -320,15 +320,13 @@ func (p *pki) dbViewHash() ([]byte, error) { //Open a bucket to get key's and values from. bu := tx.Bucket([]byte("hash")) if bu == nil { - er := fmt.Errorf("info: no db hash bucket exist") - p.errorKernel.logWarn(er) + p.errorKernel.logWarn("no db hash bucket exist", "bucket", "hash") return nil } v := bu.Get([]byte("hash")) if len(v) == 0 { - er := fmt.Errorf("info: view: hash key not found") - p.errorKernel.logWarn(er) + p.errorKernel.logWarn("dbViewHash: get bucket equals", "length", 0) return nil } diff --git a/errorkernel.go b/errorkernel.go index cc5a6f3..bed2230 100644 --- a/errorkernel.go +++ b/errorkernel.go @@ -260,7 +260,7 @@ func (e *errorKernel) errSend(proc process, msg Message, err error, logLevel log case logInfo: e.logInfo("info", err) case logWarning: - e.logWarn(err) + e.logWarn("warn", err) case logDebug: e.logDebug(err) } @@ -289,8 +289,8 @@ func (e *errorKernel) logInfo(msg string, args ...any) { slog.Info(msg, args...) } -func (e *errorKernel) logWarn(err error) { - slog.Warn("warn", err.Error()) +func (e *errorKernel) logWarn(msg string, args ...any) { + slog.Warn(msg, args...) } func (e *errorKernel) logDebug(err error) {