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

refactoring logging in jobs to use child logger for common properties #215

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

aimenhamed
Copy link
Collaborator

No description provided.

@@ -10,21 +10,16 @@ export const handleFigmaFileUpdateEvent = async (
figmaTeam: FigmaTeam,
): Promise<void> => {
const { file_key: fileKey, webhook_id: webhookId } = requestBody;
const logger = getLogger().child({ job: JOB_NAME, webhookId });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: Since JOB_NAME is not used among multiple places anymore, consider simply inlining its value here and getting rid of the JOB_NAME constant.

const logger = getLogger().child({ job: 'handleFigmaFileUpdateEvent', webhookId });

The same is applicable to another changed file.

Copy link
Collaborator

@akostevich-atlassian akostevich-atlassian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice: Awesome job! This small improvement establishes a good pattern, which can be reused down the road 👍

@akostevich-atlassian akostevich-atlassian merged commit 4cd39fd into main Feb 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants