How to print the stack of an error variable rather than the stack at the time the log method is called

Using the following method will only print the string description of the error, and the stack is just the stack at the time the log method Error is called:

  1. g.Log().Error(ctx, err)

If you want to print the stack of the error variable, and not the stack when the Error method is called, you can do it as follows:

  1. g.Log().Printf(ctx, "%+v", err)

Reference links: