// ShoutAs logs a line with the Shout color
179773
func (g *group) ShoutAs(name string, format string, args ...interface{}) {
	g.addLine(name, shout, format, args)
}
527812
func Red(ctx context.Context, format string, args ...interface{}) {
	if IsHidden(ctx) && !ctxutil.IsDebug(ctx) {
		return
	}
	fmt.Fprint(Stdout, color.RedString(Prefix(ctx)+format+newline(ctx), args...))
}
1363713
func (s *stream) WarnAs(name string, format string, args ...interface{}) {
	s.log.output(s.quiet, &line{name, s.log.format(s.timestamps, warn, format, args), s})
}
1260257
func NewSlackLogger(opts *SlackOptions, token string, l LevelInfo) (Sender, error) {
	if err := opts.Validate(); err != nil {
		return nil, err
	}

	s := &slackJournal{
		opts: opts,
		Base: NewBase(opts.Name),
	}

	s.opts.client.Create(token)

	if err := s.SetLevel(l); err != nil {
		return nil, err
	}

	if _, err := s.opts.client.AuthTest(); err != nil {
		return nil, fmt.Errorf("slack authentication error: %v", err)
	}

	fallback := log.New(os.Stdout, "", log.LstdFlags)
	if err := s.SetErrorHandler(ErrorHandlerFromLogger(fallback)); err != nil {
		return nil, err
	}

	s.reset = func() {
		fallback.SetPrefix(fmt.Sprintf("[%s] ", s.Name()))
	}

	s.SetName(opts.Name)

	return s, nil
}
1005184
func NewStdLogger(time, debug, trace, colors, pid bool) *Logger {
	flags := 0
	if time {
		flags = log.LstdFlags | log.Lmicroseconds
	}

	pre := ""
	if pid {
		pre = pidPrefix()
	}

	l := &Logger{
		logger: log.New(os.Stderr, pre, flags),
		debug:  debug,
		trace:  trace,
	}

	if colors {
		setColoredLabelFormats(l)
	} else {
		setPlainLabelFormats(l)
	}

	return l
}
114837
func Log(msg string, v ...interface{}) {
	fmt.Printf("     %s\n", colors.Purple(fmt.Sprintf(msg, v...)))
}
953599
func (formatter *Formatter) Color(text string) string {
	var levelColor []byte
	if formatter.Event.Level >= event.Error {
		levelColor = colors.Red
	} else if formatter.Event.Level == event.Warning {
		levelColor = colors.Yellow
	} else {
		levelColor = colors.Cyan
	}
	return fmt.Sprintf("%s%s%s", levelColor, text, colors.Reset)
}
545341
func BgWhite(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.BgWhite()
	}
	return value{value: arg, color: WhiteBg}
}
1109298
func (c *Color) Sprint(a ...interface{}) string {
	return c.wrap(fmt.Sprint(a...))
}
624420
func (logger *Logger) log(logClass LogClass, message string) {
	ld := logger.newLineData(logClass, message)
	b := &backgroundLineLogger{
		lineData: *ld,
		logger:   logger,
	}
	transitChannel <- b
}
610728
func (l *lexer) emit(t tokenType) {
	val := ""
	if l.pos <= len(l.input) {
		val = l.input[l.start:l.pos]
	}

	tok := token{val, t, Pos{l.line, l.offset}}

	if c := strings.Count(val, "\n"); c > 0 {
		l.line += c
		lpos := strings.LastIndex(val, "\n")
		l.offset = len(val[lpos+1:])
	} else {
		l.offset += len(val)
	}

	l.tokens <- tok
	l.start = l.pos
	if tok.tokenType == tokenEOF {
		close(l.tokens)
		l.mode = modeClosed
	}
}
880468
func Color(value string) *trees.Style {
	return &trees.Style{Name: "color", Value: value}
}
1304904
func Colorize(color int, msg string) string {
	//FIXME(Sha): This logic assumes that because tty is set that the terminal supports colors.
	//	This needs to be fixed via bringing in PDCurses or some other library.
	if !stdoutIsTTY {
		return msg
	}

	// Uses basic color set rather than extended set.
	return fmt.Sprintf("\033[0;%dm%s%s", color, msg, ResetCode)
}
1355049
func (p *peer) SendAnnounce(request announceData) error {
	return p2p.Send(p.rw, AnnounceMsg, request)
}
1280827
func (s *VisvalingamSimplifier) LineString(ls orb.LineString) orb.LineString {
	return lineString(s, ls)
}
959398
func AALineColor(renderer *sdl.Renderer, x1, y1, x2, y2 int32, color sdl.Color) bool {
	_x1 := C.Sint16(x1)
	_y1 := C.Sint16(y1)
	_x2 := C.Sint16(x2)
	_y2 := C.Sint16(y2)
	_color := C.Uint32(gfxColor(color))
	return C.aalineColor((*C.SDL_Renderer)(unsafe.Pointer(renderer)), _x1, _y1, _x2, _y2, _color) == 0
}
66780
func NewStyle(fg Color, args ...interface{}) Style {
	bg := ColorClear
	modifier := ModifierClear
	if len(args) >= 1 {
		bg = args[0].(Color)
	}
	if len(args) == 2 {
		modifier = args[1].(Modifier)
	}
	return Style{
		fg,
		bg,
		modifier,
	}
}