Added error logging
This commit is contained in:
parent
4ad7d8286e
commit
8830920900
6 changed files with 47 additions and 7 deletions
11
main.go
11
main.go
|
|
@ -1,14 +1,21 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"math/rand"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/flygrounder/go-mtg-vk/vk"
|
||||
"github.com/gin-gonic/gin"
|
||||
"math/rand"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
rand.Seed(time.Now().UTC().UnixNano())
|
||||
logFile, _ := os.OpenFile("logs/errors.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
||||
defer logFile.Close()
|
||||
|
||||
log.SetOutput(logFile)
|
||||
r := gin.Default()
|
||||
r.POST("callback/message", vk.HandleMessage)
|
||||
r.Run(":80")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue