Skip to content

Commit

Permalink
修改seelog
Browse files Browse the repository at this point in the history
  • Loading branch information
hwholiday committed Oct 30, 2019
1 parent 519e3a5 commit 1b14f7b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions gin/main.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package main

import (
"github.com/gin-gonic/gin"
"net/http"
"flag"
"time"
"github.com/cihub/seelog"
"os"
"fmt"
"learning_tools/gin/router"
"github.com/cihub/seelog"
"github.com/gin-gonic/gin"
"learning_tools/gin/model"
"learning_tools/gin/router"
"net/http"
"os"
"os/signal"
"syscall"
"time"
)

var addr = flag.String("addr", "127.0.0.1:8081", "server addr")
Expand Down Expand Up @@ -48,7 +48,7 @@ func main() {
seelog.Info("server run :", *addr)
quitChan := make(chan os.Signal)
signal.Notify(quitChan, os.Interrupt, os.Kill, syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP)
fmt.Println("服务启动")
seelog.Info("服务启动")
go func() {
err := s.ListenAndServe()
if err != nil {
Expand All @@ -59,6 +59,6 @@ func main() {
}()
//退出应用
<-quitChan
fmt.Println("服务退出")
s.Close()
seelog.Info("服务退出")
_ = s.Close()
}

0 comments on commit 1b14f7b

Please sign in to comment.