make get and post endpoints work, update enums to be strings, add log file output

This commit is contained in:
katefort 2025-04-23 15:34:19 -05:00
parent 79977f1a18
commit e762fc2abd
12 changed files with 94 additions and 72 deletions

22
internal/utils/logger.go Normal file
View file

@ -0,0 +1,22 @@
package utils
import (
"io"
"os"
log "github.com/sirupsen/logrus"
)
func InitializeLogger() {
file, err := os.OpenFile("app.log", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
if err != nil {
log.Fatal(err)
}
log.SetOutput(io.MultiWriter(os.Stdout, file))
log.SetFormatter(&log.TextFormatter{
FullTimestamp: true,
})
log.SetLevel(log.DebugLevel)
}