commands, log as info
This commit is contained in:
parent
3678d1d815
commit
c724bff698
@ -14,7 +14,7 @@ type PluginBuilder struct {
|
|||||||
|
|
||||||
func NewPluginBuilder(p Plugin) *PluginBuilder {
|
func NewPluginBuilder(p Plugin) *PluginBuilder {
|
||||||
logger := hclog.New(&hclog.LoggerOptions{
|
logger := hclog.New(&hclog.LoggerOptions{
|
||||||
Level: hclog.Info,
|
Level: hclog.Debug,
|
||||||
Output: os.Stderr,
|
Output: os.Stderr,
|
||||||
JSONFormat: false,
|
JSONFormat: false,
|
||||||
})
|
})
|
||||||
|
@ -82,7 +82,7 @@ func (pr *PluginRegisterBuilder) Build(ctx context.Context) (*PluginRegister, er
|
|||||||
Logger: hclog.New(&hclog.LoggerOptions{
|
Logger: hclog.New(&hclog.LoggerOptions{
|
||||||
Name: "char",
|
Name: "char",
|
||||||
Output: os.Stdout,
|
Output: os.Stdout,
|
||||||
Level: hclog.Info,
|
Level: hclog.Debug,
|
||||||
}),
|
}),
|
||||||
Cmd: exec.Command(
|
Cmd: exec.Command(
|
||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
|
@ -12,7 +12,7 @@ type GoCliPlugin struct{}
|
|||||||
|
|
||||||
// Do implements register.Plugin
|
// Do implements register.Plugin
|
||||||
func (*GoCliPlugin) Do(ctx context.Context, cmd *register.DoCommand) error {
|
func (*GoCliPlugin) Do(ctx context.Context, cmd *register.DoCommand) error {
|
||||||
hclog.L().Error("received command: %s", cmd.CommandName)
|
hclog.L().Info("received command: %s", cmd.CommandName)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,13 +5,14 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
|
|
||||||
"git.front.kjuulh.io/kjuulh/char/pkg/register"
|
"git.front.kjuulh.io/kjuulh/char/pkg/register"
|
||||||
|
"github.com/hashicorp/go-hclog"
|
||||||
)
|
)
|
||||||
|
|
||||||
type GoCliPlugin struct{}
|
type GoCliPlugin struct{}
|
||||||
|
|
||||||
// Do implements register.Plugin
|
// Do implements register.Plugin
|
||||||
func (*GoCliPlugin) Do(ctx context.Context, cmd *register.DoCommand) error {
|
func (*GoCliPlugin) Do(ctx context.Context, cmd *register.DoCommand) error {
|
||||||
log.Printf("received command: %s", cmd.CommandName)
|
hclog.L().Info("received command: %s", cmd.CommandName)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user