You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: formatter.go
    path of file: ./repos/cds/sdk/log
    
    the code of the file until where you have to start completion: package cdslog

import (
	"bytes"
	"fmt"
	"sort"
	"strings"

	"github.com/mgutz/ansi"
	"github.com/sirupsen/logrus"
)

// CDSFormatter ...
type CDSFormatter struct {
	Fields []string
}

// Format format a log
func (f *CDSFormatter) Format(entry *logrus.Entry) ([]byte, error) {
	var keys = make([]string, 0, len(entry.Data))
	for k := range entry.Data {
		if k != "prefix" {
			keys = append(keys, k)
		}
	}
	sort.Strings(keys)

	b := &bytes.Buffer{}
	prefixFieldClashes(entry.Data)
	f.printColored(b, entry, keys)

	b.WriteByte('\n')
	return b.Bytes(), nil
}

func (f *CDSFormatter) printColored(b *bytes.Buffer, entry *logrus.Entry, keys []string) {
	var levelColor string
	var levelText string
	switch entry.Level {

    
func (f *CDSFormatter) printColored(b *bytes.Buffer, entry *logrus.Entry, keys []string) {
	var levelColor string
	var levelText string
	switch entry.Level {
	case logrus.InfoLevel:
		levelColor = ansi.Green
	case logrus.WarnLevel:
		levelColor = ansi.Yellow
	case logrus.ErrorLevel, logrus.FatalLevel, logrus.PanicLevel:
		levelColor = ansi.Red
	default:
		levelColor = ansi.Blue
	}

	if entry.Level != logrus.WarnLevel {
		levelText = strings.ToUpper(entry.Level.String())
	} else {
		levelText = "WARN"
	}
	levelText = "[" + levelText + "]"

	fmt.Fprintf(b, "%s %s%+5s%s %s", entry.Time.Format("2006-01-02 15:04:05"), levelColor, levelText, ansi.Reset, entry.Message)

	for _, k := range keys {
		v := entry.Data[k]
		if f.Fields == nil || fieldsInArray(k, f.Fields) {
			fmt.Fprintf(b, " %s%s%s=%+v", levelColor, k, ansi.Reset, v)
		}
	}
}