Bugs item #1765517, was opened at 2007-08-01 17:39
Message generated for change (Comment added) made by miconda
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: Daniel-Constantin Mierla (miconda)
Date: 2007-10-05 16:24

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

$(Cxx) is the old version, in 1.3 $C(xx) has to be used. Also, $C... were
moved to xlog module.

Regarding the issue, I think this is a matter of how the syslog interprets
and writes the escape sequences. Of course, if you write the escape
sequence to a variable and printed, the openser couldn't detect it in 1.2,
so it was printed. The detection of color variables in 1.2 was based on
checking the name, not the content.

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

Comment By: Iñaki Baz (ibc_sf)
Date: 2007-10-03 14: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:[EMAIL PROTECTED]
  Oct  3 13:27:45 openser /usr/sbin/openser[25802]:
sip:[EMAIL PROTECTED]

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 13: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

_______________________________________________
Devel mailing list
Devel@openser.org
http://openser.org/cgi-bin/mailman/listinfo/devel

Reply via email to