2020-04-13 00:12:48 +00:00
|
|
|
// +build !js,!wasm
|
2019-12-23 02:33:54 +00:00
|
|
|
|
|
|
|
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()))
|
|
|
|
}
|