[OpenSIPS-Devel] [opensips] xlog support for multiple lines (#538)

Jarrod Baumann notifications at github.com
Wed Jun 3 01:32:40 CEST 2015


The only thing lacking in producing well formatted scripts (< 80 columns) has been xlog multiline support.  This PR works by collapsing the multiple elements into the single element by further populating the linked list.  

### script example
startup_route {
    $var(prefix) = "test   :";
    xlog("===============< BEGIN TEST >======================\n");
    xlog("L_INFO","single no pvar\n");
    xlog("L_INFO","double no pvar : line 1, ",
                  "line 2\n");
    xlog("L_INFO","$var(prefix) single line\n");
    xlog("L_INFO","$var(prefix) double : line 1, ",
                  "line 2\n");
    xlog("L_INFO", "$var(prefix) double pvar : line 1, ",
                   "line 2 with pvar $var(prefix)\n");
    xlog("L_INFO", "$var(prefix) triple pvar : line 1, ",
                   "line 2, ",
                   "line 3 with pvar $var(prefix)\n");
    xlog("L_INFO", "$var(prefix) quadruple : line 1, ",
                   "line 2, ",
                   "line 3, ",
                   "line 4 - LONGEST_ACTION_SIZE\n");
    xlog("===============< END TEST >======================\n\n");
}

### log output
```
Jun  2 09:01:41 opensandra opensips: ===============< BEGIN TEST >======================
Jun  2 09:01:41 opensandra opensips: single no pvar
Jun  2 09:01:41 opensandra opensips: double no pvar : line 1, line 2
Jun  2 09:01:41 opensandra opensips: test   : single line
Jun  2 09:01:41 opensandra opensips: test   : double : line 1, line 2
Jun  2 09:01:41 opensandra opensips: test   : double pvar : line 1, line 2 with pvar test   :
Jun  2 09:01:41 opensandra opensips: test   : triple : line 1, line 2, line 3 with pvar test   :
Jun  2 09:01:41 opensandra opensips: test   : quadruple : line 1, line 2, line 3, line 4 - LONGEST_ACTION_SIZE
Jun  2 09:01:41 opensandra opensips: ===============< END TEST >======================
```
You can view, comment on, or merge this pull request online at:

  https://github.com/OpenSIPS/opensips/pull/538

-- Commit Summary --

  * xlog support for multiple lines

-- File Changes --

    M cfg.y (24)
    M route.c (129)

-- Patch Links --

https://github.com/OpenSIPS/opensips/pull/538.patch
https://github.com/OpenSIPS/opensips/pull/538.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/OpenSIPS/opensips/pull/538
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/devel/attachments/20150602/8cffffcf/attachment.htm>


More information about the Devel mailing list