Add logging
This commit is contained in:
16
cmd/server/commands/root.go
Normal file
16
cmd/server/commands/root.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func CreateServerCmd(logger *zap.Logger) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "krakenserver",
|
||||
}
|
||||
|
||||
cmd.AddCommand(NewStartServerCommand(logger))
|
||||
|
||||
return cmd
|
||||
}
|
21
cmd/server/commands/start.go
Normal file
21
cmd/server/commands/start.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func NewStartServerCommand(logger *zap.Logger) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "start",
|
||||
Short: "Start the kraken server",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
|
||||
return errors.New("some error")
|
||||
},
|
||||
}
|
||||
|
||||
return cmd
|
||||
}
|
Reference in New Issue
Block a user