// ShoutAs logs a line with the Shout color
333565
func (s *stream) ShoutAs(name string, format string, args ...interface{}) {
	s.log.output(s.quiet, &line{name, s.log.format(s.timestamps, shout, format, args), s})
}
1280827
func (s *VisvalingamSimplifier) LineString(ls orb.LineString) orb.LineString {
	return lineString(s, ls)
}
527300
func (l *Lexer) Emit(t TokenType) {
	debugf("emit: %s  '%s'  stack=%v start=%d pos=%d", t, l.input[l.start:l.pos], len(l.stack), l.start, l.pos)
	// We are going to use 1 based indexing (not 0 based) for lines
	// because humans don't think that way
	if l.lastQuoteMark != 0 {
		l.lastToken = Token{T: t, V: l.input[l.start:l.pos], Quote: l.lastQuoteMark, Line: l.line + 1, Column: l.columnNumber(), Pos: l.pos}
		l.lastQuoteMark = 0
	} else {
		l.lastToken = Token{T: t, V: l.input[l.start:l.pos], Line: l.line + 1, Column: l.columnNumber(), Pos: l.pos}
	}
	l.tokens <- l.lastToken
	l.start = l.pos
}
1355049
func (p *peer) SendAnnounce(request announceData) error {
	return p2p.Send(p.rw, AnnounceMsg, request)
}
1153771
func (v *VoiceConnection) Speaking(b bool) (err error) {

	v.log(LogDebug, "called (%t)", b)

	type voiceSpeakingData struct {
		Speaking bool `json:"speaking"`
		Delay    int  `json:"delay"`
	}

	type voiceSpeakingOp struct {
		Op   int               `json:"op"` // Always 5
		Data voiceSpeakingData `json:"d"`
	}

	if v.wsConn == nil {
		return fmt.Errorf("no VoiceConnection websocket")
	}

	data := voiceSpeakingOp{5, voiceSpeakingData{b, 0}}
	v.wsMutex.Lock()
	err = v.wsConn.WriteJSON(data)
	v.wsMutex.Unlock()

	v.Lock()
	defer v.Unlock()
	if err != nil {
		v.speaking = false
		v.log(LogError, "Speaking() write json error, %s", err)
		return
	}

	v.speaking = b

	return
}
1091723
func (etwLogger *etwLogs) Log(msg *logger.Message) error {
	if providerHandle == windows.InvalidHandle {
		// This should never be hit, if it is, it indicates a programming error.
		errorMessage := "ETWLogs cannot log the message, because the event provider has not been registered."
		logrus.Error(errorMessage)
		return errors.New(errorMessage)
	}
	m := createLogMessage(etwLogger, msg)
	logger.PutMessage(msg)
	return callEventWriteString(m)
}
1203438
func (containers Containers) Logs(follow bool, timestamps bool, tail string, colorize bool, since string) {
	var (
		sources         = make([]multiplexio.Source, 0, 2*len(containers))
		maxPrefixLength = strconv.Itoa(containers.maxNameLength())
	)
	appendSources := func(reader io.Reader, color *ansi.Color, name string, separator string) {
		if reader != nil {
			prefix := fmt.Sprintf("%"+maxPrefixLength+"s "+separator+" ", name)
			sources = append(sources, multiplexio.Source{
				Reader: reader,
				Write:  write(prefix, color, timestamps),
			})
		}
	}
	counter := 0
	for _, container := range containers {
		var (
			logs        = container.Logs(follow, since, tail)
			stdoutColor *ansi.Color
			stderrColor *ansi.Color
		)
		for _, log := range logs {
			if colorize {
				// red has a negative/error connotation, so skip it
				ansiAttribute := ansi.Attribute(int(ansi.FgGreen) + counter%int(ansi.FgWhite-ansi.FgGreen))
				stdoutColor = ansi.New(ansiAttribute)
				// To synchronize their output, we need to multiplex stdout & stderr
				// onto the same stream. Unfortunately, that means that the user won't
				// be able to pipe them separately, so we use bold as a distinguishing
				// characteristic.
				stderrColor = ansi.New(ansiAttribute).Add(ansi.Bold)
			}
			appendSources(log.Stdout, stdoutColor, log.Name, "|")
			appendSources(log.Stderr, stderrColor, log.Name, "*")
			counter += 1
		}
	}
	if len(sources) > 0 {
		aggregatedReader := multiplexio.NewReader(multiplexio.Options{}, sources...)
		io.Copy(os.Stdout, aggregatedReader)
	}
}
23723
func Stdout() io.Writer {
	stdout := colorable.NewColorableStdout()
	if stdout == os.Stdout {
		return os.Stdout
	}

	return &WinColorTerminal{output: stdout}
}
1325385
func Underline(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.Underline()
	}
	return value{value: arg, color: UnderlineFm}
}
69013
func (c *ColorLogger) Out(bytes []byte) {
	if len(bytes) == 0 {
		return
	}
	logFmt, name := c.getLogFmt()
	message := fmt.Sprintf(logFmt, name, string(bytes))
	fmt.Print(message)
}
1331905
func (s *stream) NoticeAs(name string, format string, args ...interface{}) {
	s.log.output(s.quiet, &line{name, s.log.format(s.timestamps, notice, format, args), s})
}
306403
func (g *group) SayAs(name string, format string, args ...interface{}) {
	g.addLine(name, say, format, args)
}
1262181
func LogName(name, msg string, v ...interface{}) {
	fmt.Printf("     %s %s\n", colors.Purple(name+":"), fmt.Sprintf(msg, v...))
}
900251
func (c *Context) ColorMask(r, g, b, a bool) {
	c.Call("colorMask", r, g, b, a)
}
777044
func (l *Lexer) SkipWhiteSpaces() {
	for rune := l.Next(); unicode.IsSpace(rune); rune = l.Next() {
		if rune == '\n' {
			// New line, lets keep track of line position
			l.line++
			l.linepos = l.pos
		}
	}
	l.backup()
	l.ignore()
}
1374234
func PrintStyles() {
	// for compatibility with Windows, not needed for *nix
	stdout := colorable.NewColorableStdout()

	bgColors := []string{
		"",
		":black",
		":red",
		":green",
		":yellow",
		":blue",
		":magenta",
		":cyan",
		":white",
	}

	keys := make([]string, 0, len(Colors))
	for k := range Colors {
		keys = append(keys, k)
	}

	sort.Sort(sort.StringSlice(keys))

	for _, fg := range keys {
		for _, bg := range bgColors {
			fmt.Fprintln(stdout, padColor(fg, []string{"" + bg, "+b" + bg, "+bh" + bg, "+u" + bg}))
			fmt.Fprintln(stdout, padColor(fg, []string{"+s" + bg, "+i" + bg}))
			fmt.Fprintln(stdout, padColor(fg, []string{"+uh" + bg, "+B" + bg, "+Bb" + bg /* backgrounds */, "" + bg + "+h"}))
			fmt.Fprintln(stdout, padColor(fg, []string{"+b" + bg + "+h", "+bh" + bg + "+h", "+u" + bg + "+h", "+uh" + bg + "+h"}))
		}
	}
}
592617
func BrightRed(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.BrightRed()
	}
	return value{value: arg, color: BrightFg | RedFg}
}