[OpenSER-Devel] Request for comment : logging in OpenSER

Henning Westerholt henning.westerholt at 1und1.de
Fri Jul 13 14:12:40 CEST 2007


On Friday 13 July 2007, Bogdan-Andrei Iancu wrote:
> >> I admit it will be easier to have the macros, but if it is not something
> >> portable, I will prefer to avoid it.
> >
> > At least __FILE__ and __LINE__ should be available with sun cc, as i've
> > read in some sun man pages. And __FUNCTION__, which could be very useful,
> > could be masked with an #ifdef if this is not available. So we could use
> > this facilities.
>
> I think the __FUCTION__ is the rather useful one; anyhow we do not have
> the module name, which is the most useful one.
> maybe for module name we can export automatically a macro from
> Makefile.......maybe we can try to play with something like this....
>
> i see the most comments are about the message format. Should I
> understand the the logging layers (syslog and dprint) are ok as proposed
> design? ;)

For me the proposed changes (for dprint, as syslog stays the same) are ok. 
Perhaps you can take a look at other frameworks, for example log4c how they 
handle this problems (line number, function..) portable.

Regarding the message format we should be a little more strict:

> LOG_NOTICE("module_name:function: message")

module_name - as in the module definition "exports"
function - as in the source defined, without parameters and parenthesis

Cheers,

Henning



More information about the Devel mailing list