func NewModeAnsiColorWriter(w io.Writer, mode outputMode) io.Writer {
	if _, ok := w.(*ansiColorWriter); !ok {
		return &ansiColorWriter{
			w:    w,
			mode: mode,
		}
	}
	return w
}
NewModeAnsiColorWriter create and initializes a new ansiColorWriter
by specifying the outputMode.
package logs
import (
	"fmt"
	"io"
	"os"
	"sync"
	"time"
)
type logWriter struct {
	sync.Mutex
	writer io.Writer
}
func newLogWriter(wr io.Writer) *logWriter {
	return &logWriter{writer: wr}
}
func (lg *logWriter) println(when time.Time, msg string) {
	lg.Lock()
	h, _ := formatTimeHeader(when)
	lg.writer.Write(append(append(h, msg...), '\n'))
	lg.Unlock()
}
type outputMode int
const (
	_ outputMode = iota
	DiscardNonColorEscSeq
	OutputNonColorEscSeq
)
func NewAnsiColorWriter(w io.Writer) io.Writer {
	return NewModeAnsiColorWriter(w, DiscardNonColorEscSeq)
}