implement and use first logging event (ReadFile)

This commit is contained in:
Gregory Wells
2026-03-24 17:09:30 -04:00
parent ac20f9172d
commit 35ec6678f8
2 changed files with 28 additions and 1 deletions

View File

@@ -307,12 +307,19 @@ func cleanupSessions() {
}
}
func ReadFile(path string) ([]byte, error) {
logging.Event(logging.ReadFile, "static/blank_profile.jpg")
data, err := os.ReadFile(path)
logging.Infof("Successfully read file at %s", path)
return data, err
}
func main() {
logging.Info("Starting the server")
var err error = nil
blankPhotoData, err = os.ReadFile("static/blank_profile.jpg")
blankPhotoData, err = ReadFile("static/blank_profile.jpg")
if err != nil {
log.Fatal("Could not load blank profile image")
}