New logging design (was Re: [Box Backup-dev] COMMIT r285 - box/chris)

Ben Summers boxbackup-dev@fluffy.co.uk
Thu, 5 Jan 2006 20:57:36 +0000


On 5 Jan 2006, at 20:40, Martin Ebourne wrote:

> On Thu, 2006-01-05 at 19:58 +0000, Ben Summers wrote:
[snip]
>
>> Will there be a configure time option to compile in all DEBUG/TRACE
>> loggings stuff, even in the release build?
>
> That would be useful.

... mainly to satisfy those who have asked for it! :-)

>
>> Also, on a larger project I worked on, it was handy to have TRACEUSER
>> macros which only emitted the line if the user compiling the project
>> was as specified in the first argument.
>
> I've no idea on what sort of project that was, but I could see that
> being useful in a commercial 'team' setting, but think that would  
> not be
> so ideal for open source.
>
[snip]
> I suspect the latter approach is probably less applicable to box but I
> don't mind any of them really. The only important thing is to make it
> light weight, I don't think any of us want to be responsible for
> maintaining a heavyweight logging system nor reinventing the wheel.

Maybe not worth it then. Something simple which could be aspect or  
user based would be to have an argument to configure which specifies  
users/aspects

   ./configure --with-specific-debug=Ben,RaidFile,Diffing

and then

#define TRACEASPECT(a, b)	\
	#ifdef TRACEUSER_ASPECT_##a	\
		TRACE(b)	\
	#endif

or something with the necessary glue to #define the relevant defines.

>
>> You could also implement an extra command in bbackupctl to change the
>> logging level in a running bbackupd process, which would be handy
>> when it's doing something you want to know more about.
>
> That could be handy. What about server side? A signal maybe?

The existing command socket?

Ben