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

Delete the static logger #646

Merged
merged 1 commit into from
Apr 3, 2024
Merged

Delete the static logger #646

merged 1 commit into from
Apr 3, 2024

Conversation

bidetofevil
Copy link
Collaborator

@bidetofevil bidetofevil commented Mar 29, 2024

Goal

Burn this sucker down with gasoline. We have internal APIs that we expose so hosted SDKs can log stuff like internal errors - just the same APIs in various places so the static logger won't have to be used.

For now, we add helpers in each class so we don't have to make the same internal API calls with default parameters that aren't used. But we should really revisiting our logging strategy, not only in these classes, but elsewhere too.

There doesn't seem to be a rhyme or reason why we log debug/info/error and when we include an exception. Only the ones with exceptions will make it back to the server - the rest, we are just outputting to the logger which likely won't be looked at by anyone. So why even bother? In the off chance we need to see a client logging put to debug a problem? That's a lot of overhead for a very limited use case.

BTW, I touched some Swazzled code, so I'm including @cesarmax22 to make sure this is fine. It should be?

Testing

Modified existing tests to work. CodeConv is yelling again because of some of the exception case logging not being tested. Boo effing hoo.

@@ -139,23 +136,4 @@ internal class PublicApiTest {
}
}
}

@Test
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Shortest test life time ever lol

@@ -86,26 +84,6 @@ internal class ModuleInitBootstrapperTest {
)
}

@Test
fun `internal error service hooked up to both static and non-static SDK instance`() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So long, farewell.

@bidetofevil bidetofevil marked this pull request as ready for review April 3, 2024 06:09
@bidetofevil bidetofevil requested a review from a team as a code owner April 3, 2024 06:09
@bidetofevil bidetofevil requested a review from cesarmax22 April 3, 2024 06:10
Copy link
Contributor

@fractalwrench fractalwrench left a comment

Choose a reason for hiding this comment

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

LGTM

}

private static void logError(@NonNull String message, @Nullable Exception e) {
Embrace.getInstance().getInternalInterface().logError(message, null, null, false);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: extract getInternalInterface to variable

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm going to leave this as is for now. I like idea of making internal error recording more explicit and I'll do this as part of that refactor.

Copy link
Collaborator

@cesarmax22 cesarmax22 left a comment

Choose a reason for hiding this comment

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

lgtm

@bidetofevil bidetofevil force-pushed the hho/reset-mock-server branch from a568b3c to d25f1e0 Compare April 3, 2024 15:04
@bidetofevil bidetofevil force-pushed the hho/kill-static-logger branch from bbccb3e to 67efcdb Compare April 3, 2024 15:04
Base automatically changed from hho/reset-mock-server to master April 3, 2024 15:23
@bidetofevil bidetofevil merged commit 0dd93fb into master Apr 3, 2024
2 checks passed
@bidetofevil bidetofevil deleted the hho/kill-static-logger branch April 3, 2024 15:24
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.

3 participants