-
Notifications
You must be signed in to change notification settings - Fork 0
feat: robust logging #289
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
feat: robust logging #289
Conversation
On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]> fixed linter On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]> fixed linter On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]> fixed tests On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]> passing logger as a receiver field On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]> removed not used code On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]> fixed integration On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]> fixed test On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]> added test files to testingore On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]> fix(deps): update module github.com/golang-jwt/jwt/v5 to v5.3.0 (#291) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]> fix task cover On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]>
On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]>
…into feat/logging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some suggestions and questions.
Not related to this PR and maybe an oversight of a previous on: Why do we have a pkg
sub-package under listener
? It feels misplaced, maybe just move the two included packages out of it and align with gateway
.
The original idea behind pkg
is to have a common place in your repo for packages that could also used externally (in contrast to the internal
folder) but it's fully optional.
@@ -298,6 +300,9 @@ func TestResolveSchema(t *testing.T) { | |||
|
|||
for _, tc := range tests { | |||
t.Run(tc.name, func(t *testing.T) { | |||
log, err := logger.New(logger.DefaultConfig()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i already mentioned the github.com/openmfp/golang-commons/logger/testlogger
package with a compatible logger just for tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -90,13 +87,15 @@ func CheckClusterAccessCRDStatus(ctx context.Context, k8sClient client.Client, l | |||
|
|||
// ClusterAccessReconciler handles reconciliation for ClusterAccess resources | |||
type ClusterAccessReconciler struct { | |||
lifecycleManager *lifecycle.LifecycleManager | |||
opts reconciler.ReconcilerOpts | |||
client.Client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why embed the client and not use a struct var like in APIBindingReconciler
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turned out that this field is not used.
Removed.
…into feat/logging On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]>
On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]>
On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]>
On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]>
On-behalf-of: @SAP [email protected] Signed-off-by: Artem Shcherbatiuk <[email protected]>
The purpose of this PR - making logging more robust.
Changes
if receiver.log != nil { receiver.log(error)}
. This caused the biggest changes, because we had places where logger is not passed from top level.Testing