Skip to content

Commit

Permalink
add log hook
Browse files Browse the repository at this point in the history
  • Loading branch information
MacBookAirM2 committed May 9, 2023
1 parent 9acf52b commit a770e24
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
8 changes: 1 addition & 7 deletions examples/zinx_logger/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"fmt"
"github.com/aceld/zinx/ziface"
"github.com/aceld/zinx/zlog"
"github.com/aceld/zinx/znet"
"time"
)
Expand Down Expand Up @@ -41,14 +40,9 @@ func (t *TestRouter) PostHandle(req ziface.IRequest) {
}
}

func onLog(a []byte) {

}

func main() {
s := znet.NewServer()
s.AddRouter(1, &TestRouter{})
zlog.SetLogger(new(MyLogger))
zlog.StdZinxLog.SetOnLogListen(&onLog)
//zlog.SetLogger(new(MyLogger))
s.Serve()
}
1 change: 0 additions & 1 deletion znet/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/aceld/zinx/zconf"
"github.com/aceld/zinx/zdecoder"
"github.com/aceld/zinx/zlog"
"github.com/aceld/zinx/zmetrics"
"github.com/gorilla/websocket"

"github.com/aceld/zinx/ziface"
Expand Down

0 comments on commit a770e24

Please sign in to comment.