logrus/text_formatter_windows.go

20 lines
357 B
Go
Raw Normal View History

2018-04-03 02:15:45 +03:00
// +build !appengine,!gopherjs,windows
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)
}
}