nsmcp::LogRecordParser method stripAnsi (public)

 <instance of nsmcp::LogRecordParser[i]> stripAnsi message

Defined in /usr/local/ns/tcl/nsmcp/lib/log-record.tcl

Parameters:
message (required)

Testcases:
No testcase defined.
Source code:
if {[string first \x1b $message] < 0} {return $message}
if {![info exists :colorCodeMap]} {
    set :colorCodeMap [list  [binary decode hex 1b5b303b33326d] {}  [binary decode hex 1b5b303b33396d] {}  [binary decode hex 1b5b306d] {}  [binary decode hex 1b5b313b33316d] {}  [binary decode hex 1b5b313b33396d] {}]
}
set message [string map ${:colorCodeMap} $message]
# Preserve support for uncommon/custom SGR sequences, off the fast path.
if {[string first \x1b $message] >= 0} {regsub -all {\x1b\[[0-9;]*m} $message {} message}
return $message
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: