[OpenSER-Devel] [ openser-Bugs-1765327 ] XLOG: color ANSI code not usable for colorize system log

SourceForge.net noreply at sourceforge.net
Wed Aug 1 17:26:04 CEST 2007


Bugs item #1765327, was opened at 2007-08-01 14:28
Message generated for change (Comment added) made by ibc_sf
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1765327&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 1.2.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Iñaki Baz (ibc_sf)
Assigned to: Nobody/Anonymous (nobody)
Summary: XLOG: color ANSI code not usable for colorize system log

Initial Comment:
In background mode I'm trying to colorize openser logs.

I use XLOG with the syntax $(Cxx) and so and works nice in foregorund mode:

  xlog("L_INFO", "$(Csc)$rm $ru$(Cxx)\n");

But ni background mode it generates logs like:

  ^[[0;30;46mINVITE sip:500 at domain.org


I wonder why it doesn't generate correct ANSI code:

  \033[0;30;46m  <-- correct ANSI code
instead of:
  ^[[0;30;46m

If it would generate \033[0;30;46m (correct ANSI code) then I could colorize the log file using multitail and other colorize solutions that understand ANSI code.

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

>Comment By: Iñaki Baz (ibc_sf)
Date: 2007-08-01 16:26

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

Then, why the following command in Bash terminal print "HELLO" in color:

  echo -e "\033[0;30;46mHELLO"

while this one:

  echo -e "^[[0;30;46mHELLO"

prints ^[[0;30;46mHELLO with no color at all?

Thanks for your response.

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

Comment By: Dan (dan_pascu)
Date: 2007-08-01 15:39

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

\033 and ^[ are the same code that corresponds to ESC (0x1b). It should
work with either one, they're just different notations of the same thing.


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

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



More information about the Devel mailing list