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

How should we handle logging and errors? #22

Closed
negz opened this issue Sep 14, 2023 · 3 comments · Fixed by #31
Closed

How should we handle logging and errors? #22

negz opened this issue Sep 14, 2023 · 3 comments · Fixed by #31
Assignees
Labels
enhancement New feature or request

Comments

@negz
Copy link
Member

negz commented Sep 14, 2023

What problem are you facing?

https://pkg.go.dev/github.com/crossplane/[email protected]/pkg/errors
https://pkg.go.dev/github.com/crossplane/[email protected]/pkg/logging

You can think of crossplane-runtime as a "Go SDK" of sorts for parts of Crossplane - i.e. core and providers. We have our own error and logging libraries there. Should Functions use those libraries? Use copies/aliases from this SDK? Use the stdlib or something else?

How could Crossplane help solve your problem?

We should figure out what we want to do here. I can see a case for sticking closer to the stdlib here given that now Go can do the core things our libraries were originally created to do for us (i.e. wrap errors, and emit structured logs).

Some thoughts:

  • Admittedly I personally prefer the "UX" for the crossplane-runtime libraries to the stdlib alternatives.
  • If stdlib is good enough for Functions, is it good enough for Crossplane now too?
@phisco
Copy link
Collaborator

phisco commented Sep 18, 2023

Given that we are already importing github.com/crossplane/crossplane-runtime to access things such as composed/composite resources, there is no real value in switching to the stdlib.

@negz
Copy link
Member Author

negz commented Sep 18, 2023

@phisco WDYT about adding logging/errors packages to the SDK that just mirror/call through to c/crossplane-runtime? That at lease keeps Functions slightly decoupled and gives us the option to change how the SDK is implemented in future.

@phisco
Copy link
Collaborator

phisco commented Sep 18, 2023

That would at least make it easier to discover. Sounds good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants