sirupsen / logrus

Structured, pluggable logging for Go.
MIT License
24.76k stars 2.27k forks source link

Cannot color output sent to terminal of Vs Code Remote SSH? #1368

Closed BinBrian closed 1 year ago

BinBrian commented 1 year ago

Question

Even though I set ForceColors=true, still can't output a coloured logging on the terminal. But I can use the ASNI code to output successfully. e.g fmt.Println("\u001b[31m" + "Hello World!" + "\u001b[0m")

Maybe

I think the problem may be that it may be that the output is not tty. Is there any solution to this? I would appreciate it.

Attempt

After some experimentation, I found that "github.com/zput/zxcTool/ztLog/zt_formatter" could achieve the effect of color the section of LogLevel