[OpenSER-Devel] [ openser-Bugs-1765517 ] XLOG: force_color=0, but code appears it was in a variable

SourceForge.net noreply at sourceforge.net
Wed Oct 3 13:31:19 CEST 2007


Bugs item #1765517, was opened at 2007-08-01 15:39
Message generated for change (Comment added) made by ibc_sf
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1765517&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: ver devel
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Iñaki Baz (ibc_sf)
Assigned to: Daniel-Constantin Mierla (miconda)
Summary: XLOG:  force_color=0, but code appears it was in a variable

Initial Comment:
Using modparam("xlog", "force_color", 0) the color code $(Cxx) shouldn't appear in log (syslog), but if that color code was stored in a variable then it is printed anyway.

I mean, for using different colors for each message I do:

    switch($rm)
	   {
		case "INVITE":
			$var(color) = $(Csc);
			break;
		case "BYE":
			$var(color) = $(Csc);
			break;
		case "REGISTER":
			$var(color) = $(Csy);
			break;
                      ....
        ....
    xlog("L_INFO", "$var(color)$rm $ru$(Cxx)\n");
     

But it that way I get in the logfile ^[[0;30;43m and so for these colors. IMHO those codes shouldn't appear evei if are stored in variables.


----------------------------------------------------------------------

>Comment By: Iñaki Baz (ibc_sf)
Date: 2007-10-03 12:31

Message:
Logged In: YES 
user_id=1844020
Originator: YES

Note that I mean in syslog, not when log_stderror=yes.

With your lines, with log_stderror=yes I see two xlog in color, ok.
But with log_stderror=no and writting to Syslog (Linux Debian Etch) I
see:

  Oct  3 13:27:45 openser /usr/sbin/openser[25802]:
^[[0;34;41msip:806 at openser.domain.es
  Oct  3 13:27:45 openser /usr/sbin/openser[25802]:
sip:806 at openser.domain.es

Did you try with Syslog output?


PD: Did your lines work without error? isn't $(Cxx) instead of $C(xx) as
you wrote? I get an error.

----------------------------------------------------------------------

Comment By: Daniel-Constantin Mierla (miconda)
Date: 2007-10-03 11:58

Message:
Logged In: YES 
user_id=1246013
Originator: NO

I just tested and seems to work ok. The next lines print same output:

	$var(c) = $C(br);
	xlog("L_INFO", "$var(c)$fu$C(xx)\n");
	xlog("L_INFO", "$C(br)$fu$C(xx)\n");

Do you have a escape-capable term? Do you redirect to some file?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1765517&group_id=139143



More information about the Devel mailing list