Skip to content

Small refactor #11

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

Merged
merged 4 commits into from
Apr 26, 2021
Merged

Small refactor #11

merged 4 commits into from
Apr 26, 2021

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Apr 26, 2021

I wanted to add AMD support to experiment with migrating away from Parcel but ended up taking some time to make some improvements. Check out the individual commits for more information (should really be separate PRs probably).

Fix the Google Cloud logger types as well.
Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

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

Overall looks great! Agreed, might have been easier separate PRs but no worries!

A couple questions. Only major thing is adding a step for running tests in CI

projectId,
});
const log = logging.log(logId)
const convertSeverity = (severity: Level): gcl.protos.google.logging.type.LogSeverity => {
Copy link
Contributor

Choose a reason for hiding this comment

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

?: why do we do this? Or what is this rather?

Copy link
Member Author

@code-asher code-asher Apr 26, 2021

Choose a reason for hiding this comment

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

Our logger uses 0-4 to represent trace, debug, info, warn, and error, but Google Cloud uses something like 100, 200, 400, 500 (and has no trace level). So we need to convert the level to the right number.

Copy link
Member Author

Choose a reason for hiding this comment

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

I should also note logging to Google Cloud is optional.

@code-asher
Copy link
Member Author

Uhhh tests are failing in CI, I'll take a look tomorrow.

Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

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

🚀

Fixes #6.

This is a breaking change. We could add it to the end but the function
parameters were already getting long so I think an object works better.

Also decreased the wrapping width.
@code-asher
Copy link
Member Author

I was too curious to wait until tomorrow. All fixed up.

@code-asher code-asher merged commit 12b5444 into master Apr 26, 2021
@code-asher code-asher deleted the refactor branch April 26, 2021 23:44
@code-asher
Copy link
Member Author

Oh huh there were actually existing test files. They just use the logger though and don't actually test anything. 😛 I'll probably just remove them.

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