Exemple #1
0
func logEvent(log *logger.Logger, build models.Build, step string, err error) {
	if err != nil {
		log.Log("state=error step=build.%s app=%q build=%q error=%q", step, build.App, build.Id, err)
	} else {
		log.Success("step=build.%s app=%q build=%q", step, build.App, build.Id)
	}
}
Exemple #2
0
func Error(log *logger.Logger, err error) {
	if log != nil {
		log.Error(err)
	}

	if rollbar.Token != "" {
		extraData := map[string]string{
			"AWS_REGION": os.Getenv("AWS_REGION"),
			"RACK":       os.Getenv("RACK"),
			"RELEASE":    os.Getenv("RELEASE"),
			"VPC":        os.Getenv("VPC"),
		}
		extraField := &rollbar.Field{"env", extraData}
		rollbar.Error(rollbar.ERR, err, extraField)
	}
}
Exemple #3
0
func logError(log *logger.Logger, err *httperr.Error) {
	if err.User() {
		log.Log("state=error type=user message=%q", err.Error())
		return
	}

	err.Save()

	id := rand.Int31()

	log.Log("state=error id=%d message=%q", id, err.Error())

	for i, line := range err.Trace() {
		log.Log("state=error id=%d line=%d trace=%q", id, i, line)
	}
}