[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enhancement: Timestamps in debug file



hi Mike,

On 2/18/2011 2:58 PM, Mike Krebs wrote:
> I'd like to add the capability of putting timestamps on the debug statements in HTTPAPI.

I'd prefer that you add a 3rd parameter to http_debug().

However, there's one issue you may not have considered:
http_dwrite() is not always called for a complete 'record' of data.  For 
example, if the data to be received from the HTTP server is 'The quick 
brown fox jumped over the lazy dog', it might be received in chunks:

'The quick br'
'own f'
'ox jumped over'
'th'
'e lazy do'
'g(CRLF)'

http_dwrite() simply writes the data to the debug file, and due to the 
nature of stream files, everything up to the (CRLF) appears on the same 
line, and will look like this in the debug file:

The quick brown fox jumped over the lazy dog(CRLF)

But, if you simply added an RPG timestamp as you described, you'd end up 
with this instead:

2011-02-18-15.31.48.000000The quick br2011-02-18-15.31.48.002000own 
f2011-02-18-15.31.48.003000ox jumped 
over2011-02-18-15.31.48.011000th2011-02-18-15.31.48.012000e lazy 
do2011-02-18-15.31.48.015000g(CRLF)
2011-02-18-15.31.48.016000

I personally would find that this makes the debug file rather hard to read.

Instead, my suggestion is that we simply add a call to http_dmsg() at 
key points in the process.  So no changes would be made to http_dmsg() 
or http_dwrite().  Instead, we'd just call 
http_dmesg(%char(%timestamp:*iso)) when we wanted to insert a "time 
check" message in the log.

Because that'd be much less intrusive, we might not need to add a 
parameter to HTTP_debug().  Instead, just always have the messages 
turned on.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------