Skip to content

Commit

Permalink
fix: log app hash and hashes in hex format (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
troykessler authored May 8, 2024
1 parent eb374eb commit 28d3c53
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion engines/celestia-core-v34/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ func (l KsyncTmLogger) Info(msg string, keyvals ...interface{}) {
logger := l.logger.Info()

for i := 0; i < len(keyvals); i = i + 2 {
logger = logger.Str(fmt.Sprintf("%v", keyvals[i]), fmt.Sprintf("%v", keyvals[i+1]))
if keyvals[i] == "hash" || keyvals[i] == "appHash" {
logger = logger.Str(fmt.Sprintf("%v", keyvals[i]), fmt.Sprintf("%x", keyvals[i+1]))
} else {
logger = logger.Str(fmt.Sprintf("%v", keyvals[i]), fmt.Sprintf("%v", keyvals[i+1]))
}
}

logger.Msg(msg)
Expand Down
6 changes: 5 additions & 1 deletion engines/cometbft-v37/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ func (l KsyncCometLogger) Info(msg string, keyvals ...interface{}) {
logger := l.logger.Info()

for i := 0; i < len(keyvals); i = i + 2 {
logger = logger.Str(fmt.Sprintf("%v", keyvals[i]), fmt.Sprintf("%v", keyvals[i+1]))
if keyvals[i] == "hash" || keyvals[i] == "appHash" {
logger = logger.Str(fmt.Sprintf("%v", keyvals[i]), fmt.Sprintf("%x", keyvals[i+1]))
} else {
logger = logger.Str(fmt.Sprintf("%v", keyvals[i]), fmt.Sprintf("%v", keyvals[i+1]))
}
}

logger.Msg(msg)
Expand Down
6 changes: 5 additions & 1 deletion engines/cometbft-v38/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ func (l KsyncCometLogger) Info(msg string, keyvals ...interface{}) {
logger := l.logger.Info()

for i := 0; i < len(keyvals); i = i + 2 {
logger = logger.Str(fmt.Sprintf("%v", keyvals[i]), fmt.Sprintf("%v", keyvals[i+1]))
if keyvals[i] == "hash" || keyvals[i] == "appHash" {
logger = logger.Str(fmt.Sprintf("%v", keyvals[i]), fmt.Sprintf("%x", keyvals[i+1]))
} else {
logger = logger.Str(fmt.Sprintf("%v", keyvals[i]), fmt.Sprintf("%v", keyvals[i+1]))
}
}

logger.Msg(msg)
Expand Down
6 changes: 5 additions & 1 deletion engines/tendermint-v34/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ func (l KsyncTmLogger) Info(msg string, keyvals ...interface{}) {
logger := l.logger.Info()

for i := 0; i < len(keyvals); i = i + 2 {
logger = logger.Str(fmt.Sprintf("%v", keyvals[i]), fmt.Sprintf("%v", keyvals[i+1]))
if keyvals[i] == "hash" || keyvals[i] == "appHash" {
logger = logger.Str(fmt.Sprintf("%v", keyvals[i]), fmt.Sprintf("%x", keyvals[i+1]))
} else {
logger = logger.Str(fmt.Sprintf("%v", keyvals[i]), fmt.Sprintf("%v", keyvals[i+1]))
}
}

logger.Msg(msg)
Expand Down

0 comments on commit 28d3c53

Please sign in to comment.