Skip to content

feat: logcat integration#455

Merged
buenaflor merged 13 commits into
mainfrom
feat/logcat-instr
Mar 29, 2023
Merged

feat: logcat integration#455
buenaflor merged 13 commits into
mainfrom
feat/logcat-instr

Conversation

@buenaflor

@buenaflor buenaflor commented Mar 23, 2023

Copy link
Copy Markdown
Contributor

📜 Description

Adds a logcat subextension that has following options:

  • enabled
  • minLevel

minLevel determines which Log functions will be replaced by SentryLogcatAdapter via bytecode manipulation.

SentryLogcatAdapter will add breadcrumbs to the respective log.

This depends on: getsentry/sentry-java#2620

💡 Motivation and Context

Ref: getsentry/sentry-java#1620

💚 How did you test it?

  • Local/manual testing
  • Jadx

📝 Checklist

  • I reviewed the submitted code
  • I added tests to verify the changes
  • I updated the docs if needed
  • No breaking changes

🔮 Next steps

Update sentry-docs

@github-actions

github-actions Bot commented Mar 23, 2023

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 05b3e99

@markushi markushi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is great, well done! 🚀 please have a look at my comments

@romtsn romtsn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, besides a couple of things.

We should probably also add an integration test that verifies the instrumented bytecode can be accepted by the JVM. You could look at VisitorTest and just add a new .class fixture with some logcat calls in it and then test it analogous to other fixtures in that test.

@markushi

markushi commented Mar 27, 2023

Copy link
Copy Markdown
Member

Nicely done! You can definitely mark the PR as "read for review" now.
Before merging, let's ensure we don't forget about

@buenaflor
buenaflor marked this pull request as ready for review March 27, 2023 05:56
@buenaflor
buenaflor requested a review from markushi March 27, 2023 09:53

@markushi markushi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Well done!

@marandaneto

Copy link
Copy Markdown
Contributor

@buenaflor is this going to work for dependencies and transitive dependencies?
the question is: is the bytecode man. able to wrap the Log calls from 3rd party libs/sdks?

@markushi

Copy link
Copy Markdown
Member

@buenaflor is this going to work for dependencies and transitive dependencies? the question is: is the bytecode man. able to wrap the Log calls from 3rd party libs/sdks?

Yes, bytecode manipulation transforms all bytecode (app + all bundled dependencies)

Comment thread CHANGELOG.md

## Unreleased

### Features

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

btw the changelog is outdated, you'd need to merge against main again

@buenaflor
buenaflor merged commit 415db22 into main Mar 29, 2023
@buenaflor
buenaflor deleted the feat/logcat-instr branch March 29, 2023 08:29
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.

4 participants