add logrus and additional log outputs

This commit is contained in:
Daniel Aberger
2021-07-31 03:59:05 +02:00
parent f64e0a6457
commit 09462288b1
3 changed files with 19 additions and 1 deletions
+4 -1
View File
@@ -4,11 +4,12 @@ import (
"bufio"
"flag"
"html/template"
"log"
"math/rand"
"net/http"
"os"
"time"
log "github.com/sirupsen/logrus"
)
type Kamoji struct {
@@ -56,7 +57,9 @@ func main() {
if time.Now().Unix()-timestamp > 60 {
randomNumber = rand.Intn(len(allk.Kamojis))
timestamp = time.Now().Unix()
log.Println("rotating kamoji")
}
log.Println("served kamoji to " + r.RemoteAddr)
k := allk.Kamojis[randomNumber]
tmpl.Execute(w, k)
})