[OpenSIPS-Users] user script trace option in xlog?

Karsten Horsmann khorsmann at gmail.com
Mon Oct 25 21:35:06 EST 2021


Hi Kingsley,

You could use cfg_line

to return your linenumber in the script via xlog.


Kingsley Tart <kingsley at dns99.co.uk> schrieb am Mo., 25. Okt. 2021, 19:52:

> Hi,
>
> Is there something that I can put in an xlog() call that will show the
> trace of calling lines, a bit like "cluck" in Perl's Carp module?
>
> eg if I want to xlog an error, it would be handy for debugging purposes
> to do something like
>
> xlog("L_WARN", "You did a silly thing", 1);
>
> and in the logs, see something like
>
> You did a silly thing
>   at opensips.cfg line 2623
>   at opensips.cfg line 1874
>   at opensips.cfg line 723
>
> where line 2623 is the line with the xlog() call, line 1874 is the line
> that called the function that made the xlog() call, and line 723 is the
> line that called the function that line 1874 is in.
>
> Cheers,
> Kingsley.
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20211025/71f88a19/attachment.html>


More information about the Users mailing list