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,19 @@
// +build !appengine,!js,!windows
package logrus
import (
"io"
"os"
"golang.org/x/crypto/ssh/terminal"
)
func checkIfTerminal(w io.Writer) bool {
switch v := w.(type) {
case *os.File:
return terminal.IsTerminal(int(v.Fd()))
default:
return false
}
}