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