// LogString provides a string representation of the errors the client has seen
969544
func (c *Client) LogString() string {
	c.Lock()
	defer c.Unlock()
	var res string
	for _, e := range c.ErrLog {
		res += c.FormatError(e)
	}
	return res
}
370041
func (self *LogRecord) String() string {
	return fmt.Sprintf("<LogRecord: %s, %s, %s, %d, \"%s\">",
		self.Name, self.Level, self.PathName, self.LineNo, self.Message)
}
748037
func LogError(span opentracing.Span, message string) {
	span.SetTag("error", true)
	span.LogFields(
		log.String("event", "error"),
		log.String("message", message),
	)
}
328395
func (l Log) GoString() string {
	count := len(l)
	buf := bytes.NewBufferString("Log{")
	for key, value := range l {
		if count--; count == 0 {
			fmt.Fprintf(buf, "%s:%#v}", key, value)
		} else {
			fmt.Fprintf(buf, "%s:%#v, ", key, value)
		}
	}
	return buf.String()
}
6594
func (l *Logger) log(str string) (n int, err error) {
	return fmt.Fprint(l.sink, str)
}
1006419
func (parser *Parser) ParseString(line string) (entry *Entry, err error) {
	re := parser.regexp
	fields := re.FindStringSubmatch(line)
	if fields == nil {
		err = fmt.Errorf("access log line '%v' does not match given format '%v'", line, re)
		return
	}

	// Iterate over subexp foung and fill the map record
	entry = NewEmptyEntry()
	for i, name := range re.SubexpNames() {
		if i == 0 {
			continue
		}
		entry.SetField(name, fields[i])
	}
	return
}
778435
func (w *responseWriter) WriteString(s string) (int, error) {
	w.tryWriteHeader()
	n, err := io.WriteString(w.ResponseWriter, s)
	w.written += n
	return n, err
}
439559
func (service *Service) LogError(msg string, keyvals ...interface{}) {
	LogError(service.Context, msg, keyvals...)
}
1274411
func LogP(logLvl int, prefix string, v ...interface{}) {
	if ErrLogLevel >= logLvl && loggerErr != nil {
		loggerErr.Output(3, prefix+LogPrefix[logLvl]+fmt.Sprint(v...)+postFix)
	} else if LogLevel >= logLvl && logger != nil {
		logger.Output(3, prefix+LogPrefix[logLvl]+fmt.Sprint(v...)+postFix)
	}
}
200999
func LogLevel(levelString string) (LoggingLevel, error) {
	l, err := logging.LogLevel(levelString)
	level := LoggingLevel(l)
	if err != nil {
		level = LogError
	}
	return level, err
}
540613
func ErrorString(t testing.TB, expr interface{}, str string, args ...interface{}) {
	if IsNil(expr) { // 空值，必定没有错误
		assert(t, false, args, []interface{}{"ErrorString 失败，实际值为 Nil：[%T]", expr})
		return
	}

	if err, ok := expr.(error); ok {
		index := strings.Index(err.Error(), str)
		assert(t, index >= 0, args, []interface{}{"Error 失败，实际类型为[%T]", expr})
	}
}
402871
func (l LogType) String() string {
	var typeString string
	switch l {
	case LogTypeString:
		typeString = "string"
	case LogTypeSnapshot:
		typeString = "snapshot"
	case LogTypeHealth:
		typeString = "health"
	case LogTypeInit:
		typeString = "init"
	case LogTypeStatus:
		typeString = "status"
	default:
		typeString = "unknown"
	}
	return typeString
}
284746
func (l *Logger) Logf(level Level, format string, args ...interface{}) {
	msg := fmt.Sprintf(format, args...)
	l.Log(level, msg)
}
1202301
func (s *Server) logf(format string, args ...interface{}) {
	if s.ErrorLog != nil {
		s.ErrorLog.Printf(format, args...)
	} else {
		log.Printf(format, args...)
	}
}
24497
func (w *nullDebuggerWriter) WriteString(s string) (n int, err error) {
	return len(s), nil
}
795056
func (l *BytesBufferLogger) String() string {
	l.mux.Lock()
	defer l.mux.Unlock()
	return l.buf.String()
}
841707
func errorString(ret C.nvmlReturn_t) error {
	if ret == C.NVML_SUCCESS {
		return nil
	}
	// We need to special case this because if nvml library is not found
	// nvmlErrorString() method will not work.
	if ret == C.NVML_ERROR_LIBRARY_NOT_FOUND || C.nvmlHandle == nil {
		return errLibraryNotLoaded
	}
	err := C.GoString(C.nvmlErrorString(ret))
	return fmt.Errorf("nvml: %v", err)
}