Skip to content

Commit

Permalink
msh: improved log layout
Browse files Browse the repository at this point in the history
  • Loading branch information
gekigek99 committed Mar 9, 2023
1 parent 46852dd commit 5409fa5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/conn/conn-query.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func HandlerQuery() {
}

// infinite cycle to handle new clients queries
errco.NewLogln(errco.TYPE_INF, errco.LVL_3, errco.ERROR_NIL, "listening for new clients queries\ton %s:%d ...", config.MshHost, config.MshPortQuery)
errco.NewLogln(errco.TYPE_INF, errco.LVL_3, errco.ERROR_NIL, "%-40s %s:%d ...", "listening for new clients queries on", config.MshHost, config.MshPortQuery)
for {
// handshake / stats request read
var buf []byte = make([]byte, 1024)
Expand Down
4 changes: 2 additions & 2 deletions minecraft-server-hibernation.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ func main() {
go conn.HandlerQuery()
}

// open a listener
// open a tcp listener
listener, err := net.Listen("tcp", fmt.Sprintf("%s:%d", config.MshHost, config.MshPort))
if err != nil {
errco.NewLogln(errco.TYPE_ERR, errco.LVL_3, errco.ERROR_CLIENT_LISTEN, err.Error())
progmgr.AutoTerminate()
}

// infinite cycle to handle new clients.
errco.NewLogln(errco.TYPE_INF, errco.LVL_1, errco.ERROR_NIL, "listening for new clients connections\ton %s:%d ...", config.MshHost, config.MshPort)
errco.NewLogln(errco.TYPE_INF, errco.LVL_1, errco.ERROR_NIL, "%-40s %s:%d ...", "listening for new clients connections on", config.MshHost, config.MshPort)
for {
clientConn, err := listener.Accept()
if err != nil {
Expand Down

0 comments on commit 5409fa5

Please sign in to comment.