logrus/text_formatter_windows.go

20 lines
349 B
Go

// +build !appengine,!gopherjs
package logrus
import (
"os"
"syscall"
sequences "github.com/konsorten/go-windows-terminal-sequences"
)
func (f *TextFormatter) initTerminal(entry *Entry) {
switch v := entry.Logger.Out.(type) {
case *os.File:
handle := syscall.Handle(v.Fd())
sequences.EnableVirtualTerminalProcessing(handle, true)
}
}