UnblockNeteaseMusic / server

Revive unavailable songs for Netease Cloud Music (Refactored & Enhanced version)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature Request] 支持输出不带ANSI转义序列的纯文本日志

FrzMtrsprt opened this issue · comments

commented

如下图,如果想在Qt应用中显示运行日志的话,使用QProcess读到的运行日志是带有ANSI转义符的,输出到文本框后就会看起来一团糟。
同样,将运行日志输出至文件(例如unblockneteasemusic-win-x64.exe > log.txt)时,输出的日志仍然带有ANSI转义符。

是否能像GCC一样,在输出到非TTY设备时,输出未经ANSI转义的纯文本?

详见:Color output in console - ArchWiki

When you run a command and pipe its standard output (stdout) to less for a paged view (e.g. pacman -Qe | less), you may find that the output is no longer colored. This is usually because the program tries to detect if its stdout is an interactive terminal, in which case it prints colored text, and otherwise prints uncolored text. This is good behaviour when you want to redirect stdout to a file, e.g. pacman -Qe > pkglst-backup.txt, but less suited when you want to view output in less.

test_NpcqiZUiL5

你这个output并不是一团糟,只是win的语法高亮,你这里不显示而已吧