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("alilog %+v \n", attempt) } } func (callback *Callback) Fail(result *producer.Result) { fmt.Println("IsSuccessful", result.IsSuccessful()) fmt.Println("GetErrorCode", result.GetErrorCode()) fmt.Println("GetErrorMessage", result.GetErrorMessage()) fmt.Println("GetReservedAttempts", result.GetReservedAttempts()) fmt.Println("GetRequestId", result.GetRequestId()) fmt.Println("GetTimeStampMs", result.GetTimeStampMs()) }