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

use structured logging for email utils #5230

Merged
merged 8 commits into from
Oct 25, 2024

Conversation

rhelmer
Copy link
Collaborator

@rhelmer rhelmer commented Oct 22, 2024

References:

Jira: MNTOR-3713

Description

Use the Winston logging library from the email utils so we get structured logging in GCP. Right now log messages are split across several lines which makes it difficult to locate and link to problems.

How to test

Our logging library automatically falls back to console logging in local environments, so the output can be inspected that way. We'll want to check on stage that the output looks acceptable.

Checklist (Definition of Done)

  • Commits in this PR are minimal and have descriptive commit messages.
  • Jira ticket has been updated (if needed) to match changes made during the development process.

@rhelmer rhelmer requested a review from Vinnl October 22, 2024 17:26
@rhelmer rhelmer self-assigned this Oct 22, 2024
@rhelmer rhelmer marked this pull request as draft October 22, 2024 17:30
@rhelmer rhelmer removed the request for review from Vinnl October 22, 2024 17:30
@rhelmer rhelmer requested a review from Vinnl October 22, 2024 17:36
@rhelmer rhelmer marked this pull request as ready for review October 22, 2024 17:36
Copy link

1 similar comment
Copy link

Copy link

Copy link
Collaborator

@Vinnl Vinnl left a comment

Choose a reason for hiding this comment

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

Nice!

jest.config.cjs Show resolved Hide resolved
src/utils/email.test.ts Outdated Show resolved Hide resolved
Instead of replacing the logger module by the `console.*` variants,
and then mocking those variants and inspecting their calls, we can
just directly look at the calls to the mocked module.
Copy link

Copy link

Copy link

Copy link

@rhelmer rhelmer merged commit 77df206 into main Oct 25, 2024
16 checks passed
@rhelmer rhelmer deleted the MNTOR-3713/use-structured-logging-email-util branch October 25, 2024 20:25
Copy link

Cleanup completed - database 'blurts-server-pr-5230' destroyed, cloud run service 'blurts-server-pr-5230' destroyed

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