code: func (f *textFormatter) Format(entry *log.Entry) ([]byte, error) {
  	var b *bytes.Buffer
  	if entry.Buffer != nil {
  		b = entry.Buffer
  	} else {
  		b = &bytes.Buffer{}
  	}
  
  	if f.EnableColors {
  		colorStr := logTypeToColor(entry.Level)
  		fmt.Fprintf(b, "\033%sm ", colorStr)
  	}
  
  	if !f.DisableTimestamp {
  		fmt.Fprintf(b, "%s ", entry.Time.Format(defaultLogTimeFormat))
  	}
  	if file, ok := entry.Data["file"]; ok {
  		fmt.Fprintf(b, "%s:%v:", file, entry.Data["line"])
  	}
  	fmt.Fprintf(b, " [%s] %s", entry.Level.String(), entry.Message)
  
  	if f.EnableEntryOrder {
  		keys := make([]string, 0, len(entry.Data))
  		for k := range entry.Data {
  			if k != "file" && k != "line" {
  				keys = append(keys, k)
  			}
  		}
  		sort.Strings(keys)
  		for _, k := range keys {
  			fmt.Fprintf(b, " %v=%v", k, entry.Data[k])
  		}
  	} else {
  		for k, v := range entry.Data {
  			if k != "file" && k != "line" {
  				fmt.Fprintf(b, " %v=%v", k, v)
  			}
  		}
  	}
  
  	b.WriteByte('\n')
  
  	if f.EnableColors {
  		b.WriteString("\033[0m")
  	}
  	return b.Bytes(), nil
  }
docs: // Format implements logrus.Formatter