1 // Package term provides tools for logging to a terminal. 2 // 3 // Deprecated: Use github.com/go-kit/log/term instead. 4 package term 5 6 import ( 7 "io" 8 9 "github.com/go-kit/log" 10 "github.com/go-kit/log/term" 11 ) 12 13 // NewLogger returns a Logger that takes advantage of terminal features if 14 // possible. Log events are formatted by the Logger returned by newLogger. If 15 // w is a terminal each log event is colored according to the color function. 16 func NewLogger(w io.Writer, newLogger func(io.Writer) log.Logger, color func(keyvals ...interface{}) FgBgColor) log.Logger { 17 return term.NewLogger(w, newLogger, color) 18 } 19 20 // IsTerminal returns true if w writes to a terminal. 21 func IsTerminal(w io.Writer) bool { 22 return term.IsTerminal(w) 23 } 24