diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-28 20:45:09 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2022-06-28 20:45:09 -0700 |
| commit | 0db54aa79140c6656f99a851f582c84a0de04233 (patch) | |
| tree | 7a4ef008938cfd93e4fe32c24e332f21116ef0c0 /hotline | |
| parent | 8fc43f8e53a60144f49b92a0c28b0c939a69d1c9 (diff) | |
Improve readability of client version in logs
Diffstat (limited to 'hotline')
| -rw-r--r-- | hotline/server.go | 2 | ||||
| -rw-r--r-- | hotline/transaction_handlers.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/hotline/server.go b/hotline/server.go index 3a43c95..ab61e81 100644 --- a/hotline/server.go +++ b/hotline/server.go @@ -669,7 +669,7 @@ func (s *Server) handleNewConnection(ctx context.Context, rwc io.ReadWriteCloser if c.Version == nil || bytes.Equal(c.Version, nostalgiaVersion) { c.Agreed = true c.logger = c.logger.With("name", string(c.UserName)) - c.logger.Infow("Login successful", "clientVersion", fmt.Sprintf("%x", c.Version)) + c.logger.Infow("Login successful", "clientVersion", fmt.Sprintf("%v", func() int { i, _ := byteToInt(c.Version); return i }())) for _, t := range c.notifyOthers( *NewTransaction( diff --git a/hotline/transaction_handlers.go b/hotline/transaction_handlers.go index 8ba3632..9b25ef0 100644 --- a/hotline/transaction_handlers.go +++ b/hotline/transaction_handlers.go @@ -921,7 +921,7 @@ func HandleTranAgreed(cc *ClientConn, t *Transaction) (res []Transaction, err er cc.Icon = t.GetField(fieldUserIconID).Data cc.logger = cc.logger.With("name", string(cc.UserName)) - cc.logger.Infow("Login successful", "clientVersion", fmt.Sprintf("%x", cc.Version)) + cc.logger.Infow("Login successful", "clientVersion", fmt.Sprintf("%v", func() int { i, _ := byteToInt(cc.Version); return i }())) options := t.GetField(fieldOptions).Data optBitmap := big.NewInt(int64(binary.BigEndian.Uint16(options))) |