[Mono-devel-list] Re: [Mono-list] Patch for selective logging

Paolo Molaro lupus at ximian.com
Tue Mar 4 07:03:54 EST 2003


On 03/04/03 Jerome Laban wrote:
>     This is an update for the selective logging. Thanks to gonzalo and his advices, code is now more in the "mono spirit" :)

Good starting work, my comments are below:

>   Two options are also added to command line :
>     a.. --log-level=VALUE, for which the possible values are from 2 to 7 (mapped from the G_LOG_LEVEL_XXX enum). 2 stands for error messages only, 7 for error+critical+warning+message+info+debug. 
>     b.. --log-mask=MASK, it is the decimal value of the mask. See mono-logger.h for more infos on possible values.

We should not expose magic numbers to the user (and I'm sure I won't be
able to remember the values myself and I'd have to lookup them each time
in the header file and do the math...).

--log-mask should accept something like:
	--log-mask=all
or
	--log-mask=gc,dll

The same with --log-level=error.
See, for example, in metadata/pedump.c flag_desc/flag_vals for ideas.

In mono-logger.h:
void
mono_trace_init (void);

void
mono_trace_cleanup (void);

There is no need to have init/cleanup functions: make the mono-logger.c
code lazily init stuff as needed.

Why this extra function?
void
mono_trace_set (GLogLevelFlags level, MonoTraceMask mask);

There are already two functions to set the level and mask.

The push/pop functions look also like overdesign to me, but I guess you
can leave them there if someone finds a need for them someday.

In mono-logger.c:

The GC-related stuff should go into metadata/gc.c instead
(guarded by the usual #if HAVE_BOEHM_GC checks).

Thanks!

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list