-
Notifications
You must be signed in to change notification settings - Fork 654
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
Better logging for backend components #3939
Changes from 12 commits
639f32c
6f1893f
fd09c66
89596c3
b313b89
18af03d
e1daf6c
5020b15
b13a59b
fb1cbf4
ad0f1da
5f187d9
a9a7a71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ import ( | |
"github.com/litmuschaos/litmus/litmus-portal/graphql-server/graph/model" | ||
"github.com/litmuschaos/litmus/litmus-portal/graphql-server/pkg/authorization" | ||
imageRegistryOps "github.com/litmuschaos/litmus/litmus-portal/graphql-server/pkg/image_registry/ops" | ||
"github.com/sirupsen/logrus" | ||
log "github.com/sirupsen/logrus" | ||
) | ||
|
||
func (r *mutationResolver) CreateImageRegistry(ctx context.Context, projectID string, imageRegistryInfo model.ImageRegistryInput) (*model.ImageRegistryResponse, error) { | ||
|
@@ -22,7 +22,8 @@ func (r *mutationResolver) CreateImageRegistry(ctx context.Context, projectID st | |
|
||
ciResponse, err := imageRegistryOps.CreateImageRegistry(ctx, projectID, imageRegistryInfo) | ||
if err != nil { | ||
logrus.Error(err) | ||
log.Error(err) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you convert all if err != nil condition logs to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @S-ayanide, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that is the expectation, if something in the middle goes wrong we'd want to terminate that function with a Fatal message. @amityt correct me if I'm wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, |
||
return nil, err | ||
} | ||
return ciResponse, err | ||
} | ||
|
@@ -37,7 +38,8 @@ func (r *mutationResolver) UpdateImageRegistry(ctx context.Context, imageRegistr | |
|
||
uiRegistry, err := imageRegistryOps.UpdateImageRegistry(ctx, imageRegistryID, projectID, imageRegistryInfo) | ||
if err != nil { | ||
logrus.Error(err) | ||
log.Error(err) | ||
namkyu1999 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return nil, err | ||
} | ||
|
||
return uiRegistry, err | ||
|
@@ -53,7 +55,8 @@ func (r *mutationResolver) DeleteImageRegistry(ctx context.Context, imageRegistr | |
|
||
diRegistry, err := imageRegistryOps.DeleteImageRegistry(ctx, imageRegistryID, projectID) | ||
if err != nil { | ||
logrus.Error(err) | ||
log.Error(err) | ||
namkyu1999 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return "", err | ||
} | ||
|
||
return diRegistry, err | ||
|
@@ -69,7 +72,8 @@ func (r *queryResolver) ListImageRegistry(ctx context.Context, projectID string) | |
|
||
imageRegistries, err := imageRegistryOps.ListImageRegistries(ctx, projectID) | ||
if err != nil { | ||
logrus.Error(err) | ||
log.Error(err) | ||
namkyu1999 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return nil, err | ||
} | ||
|
||
return imageRegistries, err | ||
|
@@ -85,7 +89,8 @@ func (r *queryResolver) GetImageRegistry(ctx context.Context, imageRegistryID st | |
|
||
imageRegistry, err := imageRegistryOps.GetImageRegistry(ctx, imageRegistryID, projectID) | ||
if err != nil { | ||
logrus.Error(err) | ||
log.Error(err) | ||
namkyu1999 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return nil, err | ||
} | ||
|
||
return imageRegistry, err | ||
|
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.