[reSIProcate] Log::initialize should take log level in upper or lower case (rutil)

Scott Godin sgodin at sipspectrum.com
Wed May 14 10:29:50 CDT 2014


I can't see a downside as well.  Feel free to post "patch" files to this
list for inclusion in the project.  This one is very simple though - no
need for a patch file.  I can apply it.

Note:  strcasecmp is not available on all platforms - I will use resip
internal isEqualNoCase instead.

Thanks!
Scott


On Wed, May 14, 2014 at 11:17 AM, John Gregg <jgregg at aylus.com> wrote:

>
> In rutil/Log.cxx:
>
> When application code initializes the logging system in resiprocate, it
> passes the log level (sensitivity) to Log::initialize() as a string. This
> string is translated to an internal Log::Level enum by Log::toLevel().
> Log::toLevel() is smart about stripping a preceding "LOG_" (if present),
> but it demands that the string be upper case (it uses a straight strcmp()
> to compare with hardcoded strings in mDescriptions[]). People may want,
> e.g., to use strings from prioritynames[] in syslog.h under linux, which
> are lower-case. It seems we should accept "crit" just as much as "CRIT".
> This would be a simple change of strcmp => strcasecmp in Log::toLevel(). I
> don't see a downside.
>
> I do not have permission to modify resiprocate code myself. Is this the
> proper way to feed suggestions into the community?
>
> -John Gregg
>
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel at resiprocate.org
> https://list.resiprocate.org/mailman/listinfo/resiprocate-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20140514/9fc4810b/attachment.htm>


More information about the resiprocate-devel mailing list