diff options
Diffstat (limited to 'appservice/matrix.go')
-rw-r--r-- | appservice/matrix.go | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/appservice/matrix.go b/appservice/matrix.go index c85861d..88c4b5d 100644 --- a/appservice/matrix.go +++ b/appservice/matrix.go @@ -3,12 +3,13 @@ package appservice import ( "fmt" "net/url" - "log" "net/http" "time" "bytes" "encoding/json" + log "github.com/sirupsen/logrus" + . "git.deuxfleurs.fr/Deuxfleurs/easybridge/mxlib" ) @@ -24,7 +25,7 @@ func init() { } func mxGetApiCall(endpoint string, response interface{}) error { - log.Printf("Matrix GET request: %s\n", endpoint) + log.Debugf("Matrix GET request: %s\n", endpoint) req, err := http.NewRequest("GET", config.Server + endpoint, nil) if err != nil { @@ -40,7 +41,7 @@ func mxPutApiCall(endpoint string, data interface{}, response interface{}) error return err } - log.Printf("Matrix PUT request: %s %s\n", endpoint, string(body)) + log.Debugf("Matrix PUT request: %s %s\n", endpoint, string(body)) req, err := http.NewRequest("PUT", config.Server + endpoint, bytes.NewBuffer(body)) if err != nil { @@ -57,7 +58,7 @@ func mxPostApiCall(endpoint string, data interface{}, response interface{}) erro return err } - log.Printf("Matrix POST request: %s %s\n", endpoint, string(body)) + log.Debugf("Matrix POST request: %s %s\n", endpoint, string(body)) req, err := http.NewRequest("POST", config.Server + endpoint, bytes.NewBuffer(body)) if err != nil { @@ -82,7 +83,7 @@ func mxDoAndParse(req *http.Request, response interface{}) error { if err != nil { return err } - log.Printf("Response (%d): %#v\n", resp.StatusCode, e) + log.Debugf("Response (%d): %#v\n", resp.StatusCode, e) return &e } @@ -91,7 +92,7 @@ func mxDoAndParse(req *http.Request, response interface{}) error { return err } - log.Printf("Response: %#v\n", response) + log.Debugf("Response: %#v\n", response) return nil } |