Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: Implement Conduit Logger #2034

Open
raulb opened this issue Dec 19, 2024 · 0 comments
Open

CLI: Implement Conduit Logger #2034

raulb opened this issue Dec 19, 2024 · 0 comments

Comments

@raulb
Copy link
Member

raulb commented Dec 19, 2024

Similarly to how we implemented it in meroxa's CLI: https://github.com/meroxa/cli/tree/4836e3d078f42ae19e48234d24300bac50e62734/log

This would let us provide a --json flag and automatically print out what we'd like (among other benefits):

Conduit Commands would need to implement:

_ ecdysis.CommandWithLogger  = (*MyCommand)(nil)

type MyCommand struct {
  logger log.Logger
}

func (c *MyCommand) Logger(logger log.Logger) {
	c.logger = logger
}

func (c *MyCommand) Execute(ctx context.Context) error {
       // var prettyJSON
	c.logger.JSON(ctx, prettyJSON.String())
	c.logger.Info(ctx, "hello world")
	return nil
}

Part of #1911

This was referenced Dec 19, 2024
@raulb raulb moved this from Triage to Todo in Conduit Main Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant