我正尝试在Go中记录错误报告给Stackdriver错误报告。在错误报告的第一页上,声明“通过将应用程序错误记录到Google Stackdriver Logging或...”(https://cloud.google.com/error-reporting/docs/),可以实现应用程序的报告错误。我如何使用Go客户端库来做到这一点?如何将错误记录到Stackdriver错误报告通过Stackdriver记录
由记录库提供的Entry
构造是这样的:
github.com/GoogleCloudPlatform/.../logging.go#L412
type Entry struct {
Timestamp time.Time
Severity Severity
Payload interface{}
Labels map[string]string
InsertID string
HTTPRequest *HTTPRequest
Operation *logpb.LogEntryOperation
LogName string
Resource *mrpb.MonitoredResource
}
我需要元帅this JSON结构到有效载荷?或者我可以插入stacktrace作为字符串?