haiwai-grlogs/logs/alils/callback.go
2020-05-04 21:10:20 +08:00

26 lines
579 B
Go

package alils
import (
"fmt"
"github.com/aliyun/aliyun-log-go-sdk/producer"
)
type Callback struct {
}
func (callback *Callback) Success(result *producer.Result) {
attemptList := result.GetReservedAttempts()
for _, attempt := range attemptList {
fmt.Printf("%+v \n", attempt)
}
}
func (callback *Callback) Fail(result *producer.Result) {
fmt.Println(result.IsSuccessful())
fmt.Println(result.GetErrorCode())
fmt.Println(result.GetErrorMessage())
fmt.Println(result.GetReservedAttempts())
fmt.Println(result.GetRequestId())
fmt.Println(result.GetTimeStampMs())
}