sahaya / rest-assured

Automatically exported from code.google.com/p/rest-assured
0 stars 0 forks source link

Add support to log request method/path seperately #368

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently the RequestPrinter only supports printing the request method and path 
if the log detail is ALL:
if (logDetail == ALL) {
    addSingle(builder, "Request method:", requestMethod);
    addSingle(builder, "Request path:", completeRequestPath);
    addProxy(requestSpec, builder);
}

It would be nice to be able to log this portion on its own as you can with the 
params, headers, cookies, and body portions of the request.

What version of the product are you using?
2.3.4

Original issue reported on code.google.com by Daniel.K...@gmail.com on 3 Nov 2014 at 10:20

GoogleCodeExporter commented 9 years ago

Original comment by johan.ha...@gmail.com on 10 Nov 2014 at 7:15

GoogleCodeExporter commented 9 years ago
Are you looking for both the method and path at the same time or only one at a 
time?

Original comment by johan.ha...@gmail.com on 13 Nov 2014 at 6:52

GoogleCodeExporter commented 9 years ago
Yea both at the same time. My use case is I have a really large request body I 
don't want to log but I want to log everything else still. And the above 
section is the only portion that can't be specified individually to be logged.

Original comment by Daniel.K...@gmail.com on 13 Nov 2014 at 7:32

GoogleCodeExporter commented 9 years ago
Hmm so what would you call call the request method and path with the same word? 

Original comment by johan.ha...@gmail.com on 13 Nov 2014 at 7:38

GoogleCodeExporter commented 9 years ago
hmm can't think of anything of the top of my head. If it makes better sense to 
do them separately that works too.

Original comment by Daniel.K...@gmail.com on 13 Nov 2014 at 8:49

GoogleCodeExporter commented 9 years ago
I think that would be better

Original comment by johan.ha...@gmail.com on 14 Nov 2014 at 6:09

GoogleCodeExporter commented 9 years ago
I've added support for this in master. given().log().method() and 
given().log().path(). Is this ok? Or would given().log().requestMethod() and 
given().log().requestPath() be better?

Original comment by johan.ha...@gmail.com on 14 Nov 2014 at 6:41

GoogleCodeExporter commented 9 years ago
path and method should be fine.

Thanks!

Original comment by Daniel.K...@gmail.com on 14 Nov 2014 at 6:47

GoogleCodeExporter commented 9 years ago
Thanks

Original comment by johan.ha...@gmail.com on 15 Nov 2014 at 6:21