// Prints the formatted startup message.
515289
func printGatewayStartupMessage(apiEndPoints []string, backendType string) {
	strippedAPIEndpoints := stripStandardPorts(apiEndPoints)
	// If cache layer is enabled, print cache capacity.
	cacheObjectAPI := newCacheObjectsFn()
	if cacheObjectAPI != nil {
		printCacheStorageInfo(cacheObjectAPI.StorageInfo(context.Background()))
	}
	// Prints credential.
	printGatewayCommonMsg(strippedAPIEndpoints)

	// Prints `mc` cli configuration message chooses
	// first endpoint as default.
	printCLIAccessMsg(strippedAPIEndpoints[0], fmt.Sprintf("my%s", backendType))

	// Prints documentation message.
	printObjectAPIMsg()

	// SSL is configured reads certification chain, prints
	// authority and expiry.
	if globalIsSSL {
		printCertificateMsg(globalPublicCerts)
	}
}
1132748
func (p *ProgressBar) Print() {
	if p.PrependTextFunc != nil {
		p.PrependText = p.PrependTextFunc(p)
	}
	pct := p.percentage()
	clearCurrentLine()

	pcts := fmt.Sprintf("%.2f%%", pct*100)
	for len(pcts) < 7 {
		pcts = " " + pcts
	}

	tiWidth, _, _ := terminal.GetSize(int(syscall.Stdin))
	if tiWidth < 0 {
		// we're not running inside a real terminal (e.g. CI)
		// we assume a width of 80
		tiWidth = 80
	}
	barWidth := uint(math.Min(float64(p.Width), float64(tiWidth)/2.0))

	size := int(barWidth) - len(pcts) - 4
	fill := int(math.Max(2, math.Floor((float64(size)*pct)+.5)))
	if size < 16 {
		barWidth = 0
	}

	text := p.Text
	textLen := utf8.RuneCountInString(p.Text)
	maxTextWidth := tiWidth - 3 - int(barWidth) - utf8.RuneCountInString(p.PrependText)
	if maxTextWidth < 0 {
		maxTextWidth = 0
	}
	if textLen > maxTextWidth {
		if textLen-maxTextWidth+3 < textLen {
			text = "..." + string([]rune(p.Text)[textLen-maxTextWidth+3:])
		} else {
			text = ""
		}
	}

	// Print text
	s := fmt.Sprintf("%s%s  %s ",
		text,
		strings.Repeat(" ", maxTextWidth-utf8.RuneCountInString(text)),
		p.PrependText)
	fmt.Fprint(Stdout, s)

	if barWidth > 0 {
		progChar := BarFormat[2]
		if p.Current == p.Total {
			progChar = BarFormat[1]
		}

		// Print progress bar
		fmt.Fprintf(Stdout, "%c%s%c%s%c %s",
			BarFormat[0],
			strings.Repeat(string(BarFormat[1]), fill-1),
			progChar,
			strings.Repeat(string(BarFormat[3]), size-fill),
			BarFormat[4],
			pcts)
	}
}
1109673
func (buf *LogBuffer) PrintMessages(w io.Writer, max_num int) (err error) {
	if max_num <= 0 {
		return
	}
	msgStart := buf.messages
	if max_num < buf.message_buffer {
		msgStart = msgStart.Move(-max_num)
	}
	msgStart.Do(func(msg interface{}) {
		if msg != nil && err == nil {
			_, err = fmt.Fprint(w, msg)
		}
	})
	return
}
152532
func (s Server) Print() {
	log.Println("Server Configuration:")
	log.Printf("\tListening:%s:%v\n", s.BindHost, s.BindPort)
	log.Printf("\tNamespace:%s\n", s.Namespace)
	log.Printf("\tService Name:%s\n", s.ServiceName)
	log.Printf("\tAuth Token:%s\n", s.AuthToken)
	log.Printf("\tClear Namespaces?:%v\n", s.ClearNamespaces)
}
975965
func (log *SQLLogger) Printf(format string, v ...interface{}) {
	log.Debugf(format, v...)
}
340241
func (p FmtPrinter) Printf(logger *Logger, format string, a ...interface{}) {
	format = "%s " + format
	b := make([]interface{}, 1)
	b[0] = logger.Color(logger.Name)
	a = append(b, a...)
	fmt.Fprintf(os.Stderr, format, a...)
}
277077
func (ds *DummyStatus) PrintMsg(msg message) {
	if !globalJSON {
		console.Println(msg.String())
	} else {
		console.Println(msg.JSON())
	}
}
393441
func (state *ServicesState) Print(list *memberlist.Memberlist) {
	log.Println(state.Format(list))
}
345675
func Printf(foreground, background Color, format string, v ...interface{}) (int, error) {
	return Fprintf(os.Stdout, foreground, background, format, v...)
}
935469
func (p LogPrinter) Print(logger *Logger, a ...interface{}) {
	b := make([]interface{}, 1)
	b[0] = logger.Color(logger.Name)
	a = append(b, a...)
	log.Print(a...)
}
1249355
func (l *Logger) Printf(format string, args ...interface{}) {
	l.logger().Printf(format, args...)
}
183073
func (s *StatusBar) PrintStatus(msg string, clearDelay time.Duration) {
	if pdebug.Enabled {
		g := pdebug.Marker("StatusBar.PrintStatus")
		defer g.End()
	}

	s.stopTimer()

	location := s.AnchorPosition()

	w, _ := s.screen.Size()
	width := runewidth.StringWidth(msg)
	for width > w {
		_, rw := utf8.DecodeRuneInString(msg)
		width = width - rw
		msg = msg[rw:]
	}

	var pad []byte
	if w > width {
		pad = make([]byte, w-width)
		for i := 0; i < w-width; i++ {
			pad[i] = ' '
		}
	}

	fgAttr := s.styles.Basic.fg
	bgAttr := s.styles.Basic.bg

	if w > width {
		s.screen.Print(PrintArgs{
			Y:   location,
			Fg:  fgAttr,
			Bg:  bgAttr,
			Msg: string(pad),
		})
	}

	if width > 0 {
		s.screen.Print(PrintArgs{
			X:   int(w - width),
			Y:   location,
			Fg:  fgAttr | termbox.AttrReverse | termbox.AttrBold | termbox.AttrReverse,
			Bg:  bgAttr | termbox.AttrReverse,
			Msg: msg,
		})
	}
	s.screen.Flush()

	// if everything is successful AND the clearDelay timer is specified,
	// then set a timer to clear the status
	if clearDelay != 0 {
		s.setClearTimer(time.AfterFunc(clearDelay, func() {
			s.PrintStatus("", 0)
		}))
	}
}
1146597
func (cl *CaptureLogger) Printf(format string, v ...interface{}) {
	cl.Prints = append(cl.Prints, fmt.Sprintf(format, v...))
}
523278
func (n *LevelLogger) Print(v ...interface{}) {
	if !n.Enabled() {
		return
	}
	n.mu.RLock()
	n.logger.Output(callDepth, fmt.Sprint(v...))
	n.mu.RUnlock()
}
1154681
func (l Logger) Printf(format string, args ...interface{}) {
	l.fileMu.RLock()
	l.Logger.Printf(format, args...)
	l.fileMu.RUnlock()
}
1307344
func (l *Log) Println(args ...interface{}) {
	if l.loadCustomLogger() {
		l.customLogger.Println(args...)
		return
	}
	l.deflogger.Println(args...)
}
124579
func (l *Logger) Print(args ...interface{}) {
	l.mu.Lock()
	defer l.mu.Unlock()
	fmt.Fprint(l.Out, args...)
}