log icon indicating copy to clipboard operation
log copied to clipboard

ObjectMarshaler produces invalid JSON

Open hisorange opened this issue 3 months ago • 0 comments

Hey there!

In case the error provided to the logger is an ObjectMarshaler then the produced JSON will be invalid, as the current code is opens up the "error": key, then it calls the marshaller which cannot interact with the buffer and the outcome is going to be something like this:

  "goid": 1,
  "error": ,

https://github.com/phuslu/log/blob/5f015069480e507328d2af56da6d1af199b6284e/logger.go#L946

Have a nice day!

hisorange avatar Sep 13 '25 07:09 hisorange