webapp
Some checks failed
Docker Build and Publish / publish (push) Failing after 1m33s

This commit is contained in:
Eugene Howe
2026-02-17 09:47:30 -05:00
parent af09672ee3
commit b0957bfa49
102 changed files with 4213 additions and 378 deletions

19
internal/utils/logging.go Normal file
View File

@@ -0,0 +1,19 @@
package utils
import (
"fmt"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
func LogMessageFromDatabaseOperation(entityName string, operation string, dbOp func() error) (string, error) {
err := dbOp()
logMsg := fmt.Sprintf("%s %sd successfully", cases.Title(language.English).String(entityName), operation)
if err != nil {
logMsg = fmt.Sprintf("%s %s encountered an error", cases.Title(language.English).String(operation), entityName)
}
return logMsg, err
}