[asterisk-dev] gsoc: verbose logging

Russell Bryant russell at digium.com
Fri Mar 27 07:54:06 CDT 2009


Pék Dániel wrote:
> I'm Daniel Pek from Hungary, and i would like to apply for gsoc.

Thank you for your interest in the Asterisk project in the GSoC program!

> I'm just starting to get aquainted with asterisk codebase, so i think, 
> it would be a good challange to implement some ideas from section 3.

> 3/a
> I checked the code, and the changelog, and i got a little confused 
> (maybe i'm just tired...). I'll try to summarize what i think, and 
> please correct me, if i'm wrong:
> there's this patch: 
> http://svn.digium.com/view/asterisk?view=revision&revision=76555
> It makes possible to "set the core debug or verbose levels on a per-file 
> basis". The VERBOSITY_ATLEAST macro checks the __FILE__'s verbose level, 
> and some global level whether one of them is high enough.
> This means, here the per-file basis means per source-file basis, right? 
> And user can set it with handle_verbose from cli.
> So it's like, "from this source-file i need only this amount of 
> verbosity", right?

That is an accurate understanding of how it works today.

> The next thing: how verbose log messages are handled:
>  - __ast_verbose_ap directly, or with the help of the logging thread 
> sends the message to verboser functions
>  - verboser functions are registered with ast_register_verbose.

That is correct.

>  - i found some references to this function, one of them sends the 
> message to a socket, the other prints it to a console, but i couldn't 
> find any registration which prints the message to a file. does it mean 
> there's no support for verbose logging to a file?

Actually, there is support for logging VERBOSE messages to a log file.
If you look at configs/logger.conf.sample, you will see where you can
define log files.  If you add "myverboselog => verbose", then a log file
called "myverboselog" will be created and its contents will be the
verbose log messages.

> and finally, i think the solution would be an extra level setting for 
> verbosers, and it should be checked somewhere. if i noticed correctly, 
> there's no chance to write verboselog to file. So maybe a verboser, 
> which can write to files would be neccessary too.

I think you're on the right track.  However, settings associated with
the verboser isn't quite enough.  For example, in main/asterisk.c, we
have a single verboser function that is responsible for sending verbose
messages to _all_ connected Asterisk consoles (asterisk -r).  So, in
that case, you need settings associated with each connected console.

> i'm interested in the 3/c idea, just had no time for check the code for 
> now, but i will.

I'm not intimately familiar with all of the related code to this
project, but I can at least point you to the right files:

  channels/chan_oss.c
  channels/console_board.c
  channels/console_gui.c
  channels/console_video.c
  channels/console_video.h

> i've really just started to get familiar with the logger code, so every 
> help is welcomed, and i would extremly grateful if somebody would give 
> me direction.

Feel free to ask any additional questions that you may have, and good
luck with GSoC!

-- 
Russell Bryant
Digium, Inc. | Senior Software Engineer, Open Source Team Lead
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list