make get and post endpoints work, update enums to be strings, add log file output
This commit is contained in:
parent
79977f1a18
commit
e762fc2abd
12 changed files with 94 additions and 72 deletions
22
internal/utils/logger.go
Normal file
22
internal/utils/logger.go
Normal 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)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue