19 lines
359 B
Go
19 lines
359 B
Go
|
// +build !js
|
||
|
|
||
|
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()))
|
||
|
}
|