Closed TjazVracko closed 10 months ago
Describe the bug
When using the log file option (or append) for east util rtt the text has space sequences in it (since the terminal output I am viewing has color codes and is a shell).
east util rtt
Example log file:
[1;32mrtt:~$ [m[7D[J[00:00:00.475,769] [0m<inf> lr11xx_board: Event trigger set in global thread.[0m [1;32mrtt:~$ [m[7D[J[00:00:00.486,602] [0m<inf> mflt: Reset Reason, RESETREAS=0x10000[0m [1;32mrtt:~$ [m[7D[J[00:00:00.486,633] [0m<inf> mflt: Reset Causes: [0m [1;32mrtt:~$ [m[7D[J[00:00:00.486,694] [0m<inf> mflt: Software[0m [1;32mrtt:~$ [m[7D[J[00:00:00.487,518] [0m<inf> mflt: GNU Build ID: b2b06e4543b60af58af8990a8956c5e6a8d62fff[0m [1;32mrtt:~$ [m[7D[J[00:00:00.488,189] [0m<inf> version_info: ---------------------------------------------[0m [1;32mrtt:~$ [m[7D[J[00:00:00.488,220] [0m<inf> version_info: App version: 1.0.0[0m [1;32mrtt:~$ [m[7D[J[00:00:00.488,250] [0m<inf> version_info: Git describe: v1.0.0-2-g1f56cd3[0m [1;32mrtt:~$ [m[7D[J[00:00:00.488,281] [0m<inf> version_info: Git hash: 1f56cd3[0m [1;32mrtt:~$ [m[7D[J[00:00:00.488,342] [0m<inf> version_info: Git dirty: no[0m [1;32mrtt:~$ [m[7D[J[00:00:00.488,372] [0m<inf> version_info: Build type: dev[0m [1;32mrtt:~$ [m[7D[J[00:00:00.488,433] [0m<inf> version_info: NCS: 2.2.0[0m
But It should look like this:
rtt:~$ [00:00:00.475,769] <inf> lr11xx_board: Event trigger set in global thread. rtt:~$ [00:00:00.486,602] <inf> mflt: Reset Reason, RESETREAS=0x10000 rtt:~$ [00:00:00.486,633] <inf> mflt: Reset Causes: rtt:~$ [00:00:00.486,694] <inf> mflt: Software rtt:~$ [00:00:00.487,518] <inf> mflt: GNU Build ID: b2b06e4543b60af58af8990a8956c5e6a8d62fff rtt:~$ [00:00:00.488,189] <inf> version_info: --------------------------------------------- rtt:~$ [00:00:00.488,220] <inf> version_info: App version: 1.0.0 rtt:~$ [00:00:00.488,250] <inf> version_info: Git describe: v1.0.0-2-g1f56cd3 rtt:~$ [00:00:00.488,281] <inf> version_info: Git hash: 1f56cd3 rtt:~$ [00:00:00.488,342] <inf> version_info: Git dirty: no rtt:~$ [00:00:00.488,372] <inf> version_info: Build type: dev rtt:~$ [00:00:00.488,433] <inf> version_info: NCS: 2.2.0
Firmware/Software Version 0.17.3
Hardware Version /
To Reproduce
Build some project with RTT shell and logging via shell. You will see there are escape codes on each line.
Additional context
Some useful links: https://stackoverflow.com/questions/17998978/removing-colors-from-output https://superuser.com/questions/380772/removing-ansi-color-codes-from-text-stream https://unix.stackexchange.com/questions/111899/how-to-strip-color-codes-out-of-stdout-and-pipe-to-file-and-stdout
https://pypi.org/project/ansi2txt/
Describe the bug
When using the log file option (or append) for
east util rtt
the text has space sequences in it (since the terminal output I am viewing has color codes and is a shell).Example log file:
But It should look like this:
Firmware/Software Version 0.17.3
Hardware Version /
To Reproduce
Build some project with RTT shell and logging via shell. You will see there are escape codes on each line.
Additional context
Some useful links: https://stackoverflow.com/questions/17998978/removing-colors-from-output https://superuser.com/questions/380772/removing-ansi-color-codes-from-text-stream https://unix.stackexchange.com/questions/111899/how-to-strip-color-codes-out-of-stdout-and-pipe-to-file-and-stdout