문제

I am running my node app through forever and I save the log file. My problem is that the log is saved in a formatted manner. So colors end everything is saved. If I cat the code to the command line it looks nice but if I open it in any text editor I get the formatting strings as well.

^[[0;36mMongoose:^[[0m games.find({ progress: ^[[32m'waiting'^[[39m }) { fields: { _id: ^[[33m1^[[39m } }

What kind of format is this? And how can I visualize it properly in vim for example?

도움이 되었습니까?

해결책

You're seeing ANSI escape sequences.

There's ansifilter if you want to translate to plain text (strip escapes), HTML and some other (IIRC) formats.

There appears to be a Vim Script that appears to attempt something sensible with ANSI escapes here:

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top