Hijk
Hijk copied to clipboard
A request debug mode
Provide a mechanism to produce request traces to a path user specified. I'm thinking of something similar to 'tcpflow -e http' . It should probably store one request per file, and let file names contain some connection id and a timestamp. Users can know what happens in which order within a connection.
IMHO this should be global and/or local:
Local (log specific requests):
use Hijk;
use Hijk::DEBUG trace => "/tmp/hijk_debug/";
Hijk::DEBUG::request({...}); # logged
Hijk::request({...}); # not logged
Global (log all requests):
use Hijk;
use Hijk::DEBUG trace => "/tmp/hijk_debug/", global => 1;
Hijk::DEBUG::request({...}); # logged
Hijk::request({...}); # logged
Good idea, but I'd much rather have some extension of the on_connect callback mechanism, i.e. so you could enable something on compile-time that turns this on at various levels of debugging, then have your callback called. It could write the log, or do whatever else you wanted to do.