File: term.go

package info (click to toggle)
golang-github-go-kit-kit 0.13.0-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,796 kB
  • sloc: sh: 22; makefile: 11
file content (23 lines) | stat: -rw-r--r-- 726 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Package term provides tools for logging to a terminal.
//
// Deprecated: Use github.com/go-kit/log/term instead.
package term

import (
	"io"

	"github.com/go-kit/log"
	"github.com/go-kit/log/term"
)

// NewLogger returns a Logger that takes advantage of terminal features if
// possible. Log events are formatted by the Logger returned by newLogger. If
// w is a terminal each log event is colored according to the color function.
func NewLogger(w io.Writer, newLogger func(io.Writer) log.Logger, color func(keyvals ...interface{}) FgBgColor) log.Logger {
	return term.NewLogger(w, newLogger, color)
}

// IsTerminal returns true if w writes to a terminal.
func IsTerminal(w io.Writer) bool {
	return term.IsTerminal(w)
}