From fdcdac68c8fd0377006ca94f190b85233018b627 Mon Sep 17 00:00:00 2001 From: Richard Gooch Date: Tue, 9 Mar 2021 06:06:48 -0800 Subject: [PATCH] Clarify storage logging messages. --- cmd/keymasterd/storage.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/keymasterd/storage.go b/cmd/keymasterd/storage.go index e02abc2d..e5c51d67 100644 --- a/cmd/keymasterd/storage.go +++ b/cmd/keymasterd/storage.go @@ -384,7 +384,7 @@ func (state *RuntimeState) GetUsers() ([]string, bool, error) { } return dbMessage.Names, false, dbMessage.Err case <-time.After(state.remoteDBQueryTimeout): - logger.Printf("GOT a timeout") + logger.Println("GetUsers: timed out on primary DB") stmtText := getUsersStmt["sqlite"] stmt, err := state.cacheDB.Prepare(stmtText) if err != nil { @@ -397,7 +397,7 @@ func (state *RuntimeState) GetUsers() ([]string, bool, error) { if dbErr != nil { logger.Printf("Problem with db = '%s'", err) } else { - logger.Println("GOT data from db cache") + logger.Println("GetUsers: got data from DB cache") } return names, true, dbErr } @@ -465,7 +465,7 @@ func (state *RuntimeState) LoadUserProfile(username string) ( metricLogExternalServiceDuration("storage-read", time.Since(start)) profileBytes = dbMessage.ProfileBytes case <-time.After(state.remoteDBQueryTimeout): - logger.Printf("GOT a timeout") + logger.Println("LoadUserProfile: timed out on primary DB") fromCache = true // load from cache stmtText := loadUserProfileStmt["sqlite"] @@ -486,7 +486,7 @@ func (state *RuntimeState) LoadUserProfile(username string) ( return nil, false, true, err } } - logger.Printf("GOT data from db cache") + logger.Println("LoadUserProfile: got data from DB cache") } logger.Debugf(10, "profile bytes len=%d", len(profileBytes)) //gobReader := bytes.NewReader(fileBytes) @@ -645,7 +645,7 @@ func (state *RuntimeState) GetSigned(username string, } jwsData = dbMessage.JWSData case <-time.After(state.remoteDBQueryTimeout): - logger.Printf("GOT a timeout") + logger.Println("GetSigned: timed out on primary DB") // load from cache stmtText := getSignedUserDataStmt["sqlite"] stmt, err := state.cacheDB.Prepare(stmtText) @@ -666,9 +666,9 @@ func (state *RuntimeState) GetSigned(username string, return false, "", err } } - logger.Printf("GOT data from db cache") + logger.Println("GetSigned: got data from DB cache") } - logger.Printf("GOT some jwsdata data") + logger.Println("GetSigned: got jwsdata") storageJWT, err := state.getStorageDataFromStorageStringDataJWT(jwsData) if err != nil { logger.Debugf(2, "failed to get storage data %s data=%s", err, jwsData)