[asterisk-dev] [Code Review] Add ability for modules to dynamically register/unregister logger levels
Kevin Fleming
kpfleming at digium.com
Thu May 14 17:30:12 CDT 2009
> On 2009-05-05 09:46:44, Mark Michelson wrote:
> > /trunk/main/logger.c, lines 1369-1373
> > <http://reviewboard.digium.com/r/244/diff/2/?file=5018#file5018line1369>
> >
> > This is a bit inefficient since the loop will continue past the point that you find the first available dynamic level. You should break instead of continuing.
Actually, that's intentional; the second part of the loop needs to check every non-blank entry in the array for possible duplicates of the level being registered.
> On 2009-05-05 09:46:44, Mark Michelson wrote:
> > /trunk/main/logger.c, line 1394
> > <http://reviewboard.digium.com/r/244/diff/2/?file=5018#file5018line1394>
> >
> > I think you should make a copy of the name here since the parameter passed to this function may go out of scope while the log level is still registered. Of course, this would mean that a corresponding free should be added to the unregister function.
Will fix.
> On 2009-05-05 09:46:44, Mark Michelson wrote:
> > /trunk/main/logger.c, lines 119-129
> > <http://reviewboard.digium.com/r/244/diff/2/?file=5018#file5018line119>
> >
> > These comments should be doxygenified.
Done.
- Kevin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/244/#review766
-----------------------------------------------------------
On 2009-05-14 17:30:06, Kevin Fleming wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/244/
> -----------------------------------------------------------
>
> (Updated 2009-05-14 17:30:06)
>
>
> Review request for Asterisk Developers.
>
>
> Summary
> -------
>
> This patch adds the ability for modules to dynamically create logger levels for their own use; these are named levels just like the built-in levels, and can be directed to any destination that the logger can send any level to, by including their names in logger.conf.
>
>
> Diffs
> -----
>
> /trunk/include/asterisk/logger.h 194522
> /trunk/main/logger.c 194522
> /trunk/tests/test_logger.c PRE-CREATION
>
> Diff: http://reviewboard.digium.com/r/244/diff
>
>
> Testing
> -------
>
> Tested using included test_logger module.
>
>
> Thanks,
>
> Kevin
>
>
More information about the asterisk-dev
mailing list