fix(log): custom marshaller produce invalid data (#17532)

This commit is contained in:
Julien Robert
2023-08-25 13:14:24 +00:00
committed by GitHub
parent 4a536b21e2
commit 03fb7da26d
7 changed files with 28 additions and 24 deletions
+4
View File
@@ -22,6 +22,10 @@ Each entry must include the Github issue reference in the following format:
## [Unreleased]
## [v1.2.1](https://github.com/cosmos/cosmos-sdk/releases/tag/log/v1.2.1) - 2023-08-25
* [#17532](https://github.com/cosmos/cosmos-sdk/pull/17532) Proper marshalling of `fmt.Stringer` (follow-up of [#17205](https://github.com/cosmos/cosmos-sdk/pull/17205)).
## [v1.2.0](https://github.com/cosmos/cosmos-sdk/releases/tag/log/v1.2.0) - 2023-07-31
* [#17194](https://github.com/cosmos/cosmos-sdk/pull/17194) Avoid repeating parse log level in `ParseLogLevel`.
+1 -1
View File
@@ -19,7 +19,7 @@ func init() {
case encoding.TextMarshaler:
return json.Marshal(i)
case fmt.Stringer:
return fmt.Appendf([]byte("\""), "%s%s", v.String(), "\""), nil
return json.Marshal(v.String())
default:
return json.Marshal(i)
}