log/terminal.go
2020-04-12 17:12:48 -07:00

19 lines
365 B
Go

// +build !js,!wasm
package log
import (
"os"
"golang.org/x/crypto/ssh/terminal"
)
// Terminal module determines if an interactive shell is in use. If
// not interactive, disable colors by default. This is so deployed web apps
// log their output in plain text.
var interactive = false
func init() {
interactive = terminal.IsTerminal(int(os.Stdout.Fd()))
}