Re: debug statements to debugs statements

From: Adrian Chadd <adrian@dont-contact.us>
Date: Wed, 18 Apr 2007 17:11:18 +0800

On Wed, Apr 18, 2007, Tsantilas Christos wrote:
> Hi all,
> Here is a perl script which can be used to convert debug statements
> to new debugs statements :-) .
> It mostly works or just do standard errors.
> It does not formats the output. I think the astyle can do the rest work.
> Does not convert the debug statements, if the format string contains
> formating flags like "%2.1f".
>
> I think can be used as reference for other related convertions too.
>
> Should I proceed with the convertion?
> Should I post a patch to bugzila or open a temporary branch on
> sourceforge better?

I'm going to be slightly greedy/annoying here and say:

* Yes please! Because
* It cuts down on the amount of work required when migrating the codebase
  from C strings (and the C-string-like String type that Squid-3 is currently
  using) as there's a lot of places where C strings are debug'ed and I wasn't
  looking forward to converting them all to %*.s or similar (which allows you
  to pass an int length specifier before a buffer, a pre-requisite for
  logging strings when your strings suddenly aren't NUL-terminated!), but
* I'd just start submitting diffs against Squid-3-HEAD and include whatever can
  be done into the current codebase; this is something that can be done
  very incrementally and shouldn't have any actual operational impact, and
* It makes my next set of work easier (ie, starting to get rid of the C strings
  in Squid-3 and replacing them with String as a temporary stepping stone
  towards refcounted buffers.)

2c,

Adrian
Received on Wed Apr 18 2007 - 02:59:09 MDT

This archive was generated by hypermail pre-2.1.9 : Sun Apr 29 2007 - 12:00:03 MDT