zerolog icon indicating copy to clipboard operation
zerolog copied to clipboard

feat: allow to use a `LogArrayMarshaler` as error stacks

Open trim21 opened this issue 7 months ago • 0 comments

This will allow user to marshal error stack like this, without using json marshaler:

{
  "error": "a: raw error",
  "stack": [
    {
      "function": "main.a",
      "file": "./main.go",
      "lino": 23
    },
    {
      "function": "main.main",
      "file": "./main.go",
      "lino": 19
    },
    {
      "function": "runtime.main",
      "file": "runtime/proc.go",
      "lino": 283
    },
    {
      "function": "runtime.goexit",
      "file": "runtime/asm_amd64.s",
      "lino": 1700
    }
  ]
}

trim21 avatar May 09 '25 17:05 trim21