我正嘗試在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作爲字符串?