Skip to content

Commit

Permalink
minor log related fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
henrod committed May 10, 2019
1 parent 812e4fe commit 4f242ec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (a *Agent) Close() error {
}
a.SetStatus(constants.StatusClosed)

logger.Log.Debugf("Session closed, ID=%d, UID=%d, IP=%s",
logger.Log.Debugf("Session closed, ID=%d, UID=%s, IP=%s",
a.Session.ID(), a.Session.UID(), a.conn.RemoteAddr())

// prevent closing closed channel
Expand Down
2 changes: 1 addition & 1 deletion service/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func (h *HandlerService) Handle(conn net.Conn) {
for {
n, err := conn.Read(buf)
if err != nil {
logger.Log.Debugf("Read message error: %s, session will be closed immediately", err.Error())
logger.Log.Debugf("Read message error: '%s', session will be closed immediately", err.Error())
return
}

Expand Down
3 changes: 1 addition & 2 deletions session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ func OnSessionClose(f func(s *Session)) {

// CloseAll calls Close on all sessions
func CloseAll() {
// TODO: check if frontend?
logger.Log.Debug("closing all sessions, %d sessions", SessionCount)
logger.Log.Debugf("closing all sessions, %d sessions", SessionCount)
sessionsByID.Range(func(_, value interface{}) bool {
s := value.(*Session)
s.Close()
Expand Down

0 comments on commit 4f242ec

Please sign in to comment.