Add AddFormatter function to allow custom builds to register new formatters

This commit is contained in:
Dan Jones 2026-03-09 16:11:53 -05:00
commit 17a1cf1ade
5 changed files with 60 additions and 31 deletions

View file

@ -8,16 +8,16 @@ import (
"github.com/spf13/viper"
)
func newPlain(ff *viper.Viper) (Formatter, error) {
const FormatPlain string = "plain"
func newPlain(*viper.Viper) (Formatter, error) {
return &PlainText{}, nil
}
type PlainText struct {
// config might go here some day
}
type PlainText struct{}
func (pt *PlainText) Name() string {
return "plain"
func (*PlainText) Name() string {
return FormatPlain
}
func (pt *PlainText) Logs(logs []models.Log) (out []byte, err error) {