另客网go项目公用的代码库

terminal_windows.go 302B

12345678910111213141516171819
  1. // +build !appengine,!js,windows
  2. package logrus
  3. import (
  4. "io"
  5. "os"
  6. "syscall"
  7. sequences "github.com/konsorten/go-windows-terminal-sequences"
  8. )
  9. func initTerminal(w io.Writer) {
  10. switch v := w.(type) {
  11. case *os.File:
  12. sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true)
  13. }
  14. }