From 41f1c66772c6546fc39b9dcf64d8c04992a2e1ab Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 1 Oct 2012 12:48:26 +1300 Subject: Add -q and -r flags to pathod, logging request and respnose bytes. - These flags also mean that a bytes log is included in the internal log buffer. - There's an -x flag to turn on hex dump output in the text logs (does not affect the log buffer). --- pathod | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'pathod') diff --git a/pathod b/pathod index 91cd13e3..e692a935 100755 --- a/pathod +++ b/pathod @@ -89,7 +89,10 @@ def main(parser, args): nocraft = args.nocraft, noapi = args.noapi, nohang = args.nohang, - timeout = args.timeout + timeout = args.timeout, + logreq = args.logreq, + logresp = args.logresp, + hexdump = args.hexdump ) except pathod.PathodError, v: parser.error(str(v)) @@ -123,14 +126,6 @@ if __name__ == "__main__": "-D", dest='daemonize', default=False, action="store_true", help='Daemonize.' ) - parser.add_argument( - "-f", dest='logfile', default=None, type=str, - help='Log file.' - ) - parser.add_argument( - "--debug", dest='debug', default=False, action="store_true", - help='Enable debug output.' - ) parser.add_argument( "-s", dest='ssl', default=False, action="store_true", help='Serve with SSL.' @@ -167,6 +162,26 @@ if __name__ == "__main__": "--certfile", dest='ssl_certfile', default=None, type=str, help='SSL cert file. If not specified, a default cert is used.' ) + + + group = parser.add_argument_group('Controlling Output') + group.add_argument( + "-f", dest='logfile', default=None, type=str, + help='Log to file.' + ) + group.add_argument( + "-q", dest="logreq", action="store_true", default=False, + help="Log full request" + ) + group.add_argument( + "-r", dest="logresp", action="store_true", default=False, + help="Log full response" + ) + group.add_argument( + "-x", dest="hexdump", action="store_true", default=False, + help="Log request/response in hexdump format" + ) + args = parser.parse_args() if args.daemonize: daemonize() -- cgit v1.2.3