Skip to content

Log request and response debug log together for easy debugging #218

Closed
@jeevatkm

Description

The goal is to improve Resty debug log readability. Log request and response debug log together for easy debugging instead of separately. Importantly its highly helpful in multi-goroutine usage.

Current:

---------------------- REQUEST LOG -----------------------
POST  /login  HTTP/1.1
HOST   : 127.0.0.1:52620
HEADERS:
             Content-Type: application/json; charset=utf-8
               User-Agent: go-resty/1.11.0 (https://github.com/go-resty/resty)
BODY   :
{
   "password": "testpass",
   "username": "testuser"
}
----------------------------------------------------------
RESTY 2019/01/10 00:55:44
---------------------- RESPONSE LOG -----------------------
STATUS 		: 200 OK
RECEIVED AT	: 2019-01-10T00:55:44.218642-08:00
RESPONSE TIME	: 1.042026ms
HEADERS:
           Content-Length: 51
             Content-Type: application/json; charset=utf-8
                     Date: Thu, 10 Jan 2019 08:55:44 GMT
BODY   :
{ "id": "success", "message": "login successful", }
----------------------------------------------------------

Upcoming in v2:

RESTY 2019/01/10 00:55:44
==========================================================
POST  /login  HTTP/1.1
HOST   : 127.0.0.1:52620
HEADERS:
             Content-Type: application/json; charset=utf-8
               User-Agent: go-resty/1.11.0 (https://github.com/go-resty/resty)
BODY   :
{
   "password": "testpass",
   "username": "testuser"
}
----------------------------------------------------------
STATUS 		: 200 OK
RECEIVED AT	: 2019-01-10T00:55:44.218642-08:00
RESPONSE TIME	: 1.042026ms
HEADERS:
           Content-Length: 51
             Content-Type: application/json; charset=utf-8
                     Date: Thu, 10 Jan 2019 08:55:44 GMT
BODY   :
{ "id": "success", "message": "login successful", }
==========================================================

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions