These are chat archives for Ogeon/rustful

29th
Mar 2016
Kevin King
@kcking
Mar 29 2016 05:00
Heya -- I'm loving thislibrary! Does Rustful have any sort of automatic logging including response codes?
Erik Hedvall
@Ogeon
Mar 29 2016 08:22

That's great! Thank you!

No, nothing built in. You could, however, use a ResponseFilter to do it. Take a look at the filters example for something similar.

Kevin King
@kcking
Mar 29 2016 13:31
Ah great, thanks for the pointer!
Erik Hedvall
@Ogeon
Mar 29 2016 13:40
You're welcome. The filters have been quite neglected, so the API may be a bit rough. Feel free to let me know if you have any more questions or feedback :smile:
Kevin King
@kcking
Mar 29 2016 23:26
I am trying to log the response body only when there is a 4xx or 5xx, but it seems StatusCode is not passed to Handler::write -- is there a specific reason? (Maybe it's not semantically a good thing?) I could store whether the request was an error in the FilterContext but that seems roundabout.
Kevin King
@kcking
Mar 29 2016 23:53
Just got it working, using the AnyMap is pretty convenient :)