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

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


On Friday 13 July 2007, you wrote:
> Henning Westerholt wrote:
> > On Friday 13 July 2007, Klaus Darilion wrote:
> >>> 1) logging and message format:
> >>>   There will be different macros for each log level and the message
> >>> should include the module_name and function for a better tracking of
> >>> the messages:
> >>>
> >>>    LOG_NOTICE("module_name:function: message")
> >>>    LOG_DBG("module_name:function: message")
> >>>    LOG_ERR("module_name:function: message")
> >>
> >> is it possible to write a macro which sets "module_name" and "function"
> >> automatically?
> >
> > It's possible with gcc macros to get the file and line number i think.
>
> Exactly that's the problem - those are macros which are not standard
> across compilers. For example SUNCC does not recognize them....
>
> 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.

Does anybody have more informations about the supported preprocessor macros of 
sun cc?

Cheers,

Henning



More information about the Devel mailing list