2018-09-16 11:14:59 +03:00
|
|
|
// +build !appengine,!js,windows
|
2018-04-03 01:25:30 +03:00
|
|
|
|
|
|
|
package logrus
|
|
|
|
|
|
|
|
import (
|
2018-04-03 05:55:52 +03:00
|
|
|
"io"
|
2018-04-03 01:25:30 +03:00
|
|
|
"os"
|
|
|
|
"syscall"
|
|
|
|
|
|
|
|
sequences "github.com/konsorten/go-windows-terminal-sequences"
|
|
|
|
)
|
|
|
|
|
2018-04-03 05:55:52 +03:00
|
|
|
func initTerminal(w io.Writer) {
|
|
|
|
switch v := w.(type) {
|
2018-04-03 01:25:30 +03:00
|
|
|
case *os.File:
|
2018-04-03 05:55:52 +03:00
|
|
|
sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true)
|
2018-04-03 01:25:30 +03:00
|
|
|
}
|
|
|
|
}
|