First implementation

This commit is contained in:
2020-02-08 22:35:47 +01:00
parent f95f9753e0
commit c3dab05c54
417 changed files with 240337 additions and 0 deletions

View File

@ -0,0 +1,20 @@
// +build !appengine,!js,windows
package logrus
import (
"io"
"os"
"syscall"
)
func checkIfTerminal(w io.Writer) bool {
switch v := w.(type) {
case *os.File:
var mode uint32
err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode)
return err == nil
default:
return false
}
}