code: func (f *CustomFormatter) Format(entry *log.Entry) ([]byte, error) {
  	buffer := &bytes.Buffer{}
  	compulsoryFields := map[string]interface{}{}
  
  	compulsoryFields[fieldKeyTime] = entry.Time.Format(time.RFC3339)
  	compulsoryFields[fieldKeyMsg] = entry.Message
  	compulsoryFields[fieldKeyLevel] = f.logLevelToString(entry.Level)
  	if comp, found := entry.Data[fieldKeyComponent]; found {
  		compulsoryFields[fieldKeyComponent] = fmt.Sprint(comp)
  	} else {
  		compulsoryFields[fieldKeyComponent] = "component"
  	}
  
  	compulsoryFields[fieldKeyProcess] = os.Getpid()
  
  	// Print header (timestamp can be turned off)
  	if f.ShowTimestamp {
  		fmt.Fprint(buffer, compulsoryFields[fieldKeyTime])
  		buffer.WriteByte(' ')
  	}
  	for _, key := range compulsoryKeys[1:] {
  		fmt.Fprint(buffer, compulsoryFields[key])
  		buffer.WriteByte(' ')
  	}
  
  	// Print explicit key-value pairs
  	for k, v := range entry.Data {
  		if !f.ignoredKey(k) {
  			f.appendKeyValue(buffer, k, v)
  		}
  	}
  
  	buffer.WriteString("message=")
  	buffer.WriteByte('"')
  	fmt.Fprint(buffer, compulsoryFields[fieldKeyMsg])
  	buffer.WriteByte('"')
  	buffer.WriteByte('\n')
  
  	return buffer.Bytes(), nil
  }
docs: // Format formats the given log entry.