You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
252 B

  1. // +build !appengine
  2. package logrus
  3. import (
  4. "io"
  5. "os"
  6. "golang.org/x/crypto/ssh/terminal"
  7. )
  8. func checkIfTerminal(w io.Writer) bool {
  9. switch v := w.(type) {
  10. case *os.File:
  11. return terminal.IsTerminal(int(v.Fd()))
  12. default:
  13. return false
  14. }
  15. }