summaryrefslogtreecommitdiff
path: root/plugins/logger/tests/plugin.go
blob: 4095e59dd103190a70793294c266de05c3521b60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package tests

import (
	"github.com/spiral/errors"
	config2 "github.com/spiral/roadrunner/v2/interfaces/config"
	"github.com/spiral/roadrunner/v2/interfaces/log"
)

type Plugin struct {
	config config2.Configurer
	log    log.Logger
}

func (p1 *Plugin) Init(cfg config2.Configurer, log log.Logger) error {
	p1.config = cfg
	p1.log = log
	return nil
}

func (p1 *Plugin) Serve() chan error {
	errCh := make(chan error, 1)
	p1.log.Error("error", "test", errors.E(errors.Str("test")))
	p1.log.Info("error", "test", errors.E(errors.Str("test")))
	p1.log.Debug("error", "test", errors.E(errors.Str("test")))
	p1.log.Warn("error", "test", errors.E(errors.Str("test")))

	p1.log.Error("error", "test")
	p1.log.Info("error", "test")
	p1.log.Debug("error", "test")
	p1.log.Warn("error", "test")
	return errCh
}

func (p1 *Plugin) Stop() error {
	return nil
}

func (p1 *Plugin) Name() string {
	return "logger_plugin"
}