uber-go/zap

Add an option to override stacktrace collection logic

オープン

#514 opened on 2017/10/12

 (5 件のコメント) (6 件のリアクション) (0 人の担当者)Go (1,448 件のフォーク)batch import
help wanted

Repository metrics

Stars
 (22,391 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

Stacktrace collection

While trying to implement an encoder that is compatible with GCP Stackdriver logging and also for GCP Stackdriver Error Reporting, I suspected that it's not working properly because the generated stacktrace is not compatible with what Error Reporting is expected.

The documentation says (https://cloud.google.com/error-reporting/docs/formatting-error-messages): Go: Must be the return value of runtime.Stack()

The code in go sources (cloud.google.com/go/errors/errors.go) shows that cloud.google.com/go/errors.(*Client).logInternal indeed calls runtime.Stack.

Unfortunately, the stack is grabbed by trackStacktrace in stracktrace.go, and there is apparently no other way around to provide the stracktrace.

Unless I'm missing something, we cannot provide the way the stacktrace is grabbed by zap

コントリビューターガイド