()
| 78 | } |
| 79 | |
| 80 | func suffix() string { |
| 81 | _, file, line, ok := runtime.Caller(2) |
| 82 | if !ok { |
| 83 | return "" |
| 84 | } |
| 85 | return fmt.Sprintf("[%s:%d] ", file, line) // Note: Additionally set -trimpath when building to not leak anything from the file path |
| 86 | } |
| 87 | |
| 88 | // Similar to debug.Stack() except it skips the top 3 frames which include the logger itself |
| 89 | // to keep the logs focused on the actual relevant stack traces. |