From fbcd2dc1173e46be5646b23008e345a5845fc9d0 Mon Sep 17 00:00:00 2001 From: Reza Date: Fri, 30 Aug 2024 16:57:54 +0200 Subject: [PATCH] better messages --- tinyfaas.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tinyfaas.go b/tinyfaas.go index 9906212..a950f14 100644 --- a/tinyfaas.go +++ b/tinyfaas.go @@ -81,7 +81,7 @@ func (tf *TinyFaaS) UploadLocal(funcName string, path string, env string, thread return "", fmt.Errorf("error uploading '%s' function via local func: %v. path: %v", funcName, err, cmd.Dir) } elapsed := time.Since(start) - log.Infof("'%s' deployed successfully (%v)", funcName, elapsed) + log.Infof("(%s) '%s' deployed successfully (%v)", env, funcName, elapsed) return resp, nil } @@ -126,7 +126,7 @@ func (tf *TinyFaaS) UploadURL(funcName string, subPath string, env string, threa return resp, fmt.Errorf("Error uploading '%s' function via URL: %v", funcName, err) } elapsed := time.Since(start) - log.Infof("'%s' deployed successfully (%v)", funcName, elapsed) + log.Infof("(%s) '%s' deployed successfully (%v)", env, funcName, elapsed) return resp, nil } @@ -280,7 +280,7 @@ func checkResponse(fn func() (*resty.Response, error)) (string, error) { return "", err } if !resp.IsSuccess() { - msg := fmt.Sprintf("non-successful response (%d): resp: ()%v", resp.StatusCode(), resp.Body()) + msg := fmt.Sprintf("(%d) non-successful response. body: %v", resp.StatusCode(), resp.Body()) return "", errors.New(msg) } return string(resp.Body()), nil