✨ Add AddFormatter function to allow custom builds to register new formatters
This commit is contained in:
parent
0fbd64247a
commit
17a1cf1ade
5 changed files with 60 additions and 31 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue