✨ Add null formatter
This commit is contained in:
parent
79fa957d02
commit
632c7143f1
5 changed files with 83 additions and 2 deletions
32
formatters/null.go
Normal file
32
formatters/null.go
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package formatters
|
||||
|
||||
import (
|
||||
"codeberg.org/danjones000/my-log/config"
|
||||
"codeberg.org/danjones000/my-log/models"
|
||||
)
|
||||
|
||||
func newNull(ff config.Formatters) (Formatter, error) {
|
||||
return &Null{}, nil
|
||||
}
|
||||
|
||||
type Null struct{}
|
||||
|
||||
func (n *Null) Name() string {
|
||||
return "zero"
|
||||
}
|
||||
|
||||
func (n *Null) Meta(m models.Meta) (o []byte, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (n *Null) Entry(e models.Entry) (o []byte, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (n *Null) Log(l models.Log) (o []byte, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func (n *Null) Logs(logs []models.Log) (out []byte, err error) {
|
||||
return
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue