chore: add logger
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-01-06 21:52:07 +01:00
parent 7f64ff3b85
commit fda6d10897
6 changed files with 54 additions and 4 deletions

View File

@@ -4,11 +4,13 @@ import (
"fmt"
"os"
"github.com/spf13/cobra"
"git.front.kjuulh.io/kjuulh/orbis/internal/app"
)
func main() {
if err := newRoot().Execute(); err != nil {
app := app.NewApp()
if err := newRoot(app).Execute(); err != nil {
fmt.Printf("%s\n", err)
os.Exit(1)
}

View File

@@ -1,11 +1,22 @@
package main
import "github.com/spf13/cobra"
import (
"git.front.kjuulh.io/kjuulh/orbis/internal/app"
"github.com/spf13/cobra"
)
func newRoot(app *app.App) *cobra.Command {
logger := app.Logger()
func newRoot() *cobra.Command {
cmd := &cobra.Command{
Use: "orbis",
Short: "Orbis is a data workflow scheduler for all your batch and real-time needs",
RunE: func(cmd *cobra.Command, args []string) error {
logger.Info("starting orbis")
return nil
},
}
return cmd