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

Added code to output libSession logs #997

Conversation

mpretty-cyro
Copy link
Collaborator

This PR adds a wrapper around the libSession logging code routing logs from within libSession to come out via __android_log_print - can be setup by calling Logger.initLogger() somewhere (for testing I had it within the ConfigFactory init but wasn't sure where or if these logs were desired so haven't included the init call for now)

@mpretty-cyro mpretty-cyro self-assigned this Mar 3, 2025
@mpretty-cyro mpretty-cyro force-pushed the feature/libsession-logging branch from e4a442a to 3a339b1 Compare March 3, 2025 06:43
break;
}

__android_log_print(prio, LOG_TAG, "%.*s [%.*s]",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice! Didn't know %.*s exists

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Mm yea pretty convenience 😁

Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI there's actually no need to have this header file, given you aren't referencing this JNI method else where in C++ land, as long as the symbol is marked as JNIEXPORT it is all good to go.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah nice, I'll remove it then

@mpretty-cyro mpretty-cyro merged commit 83e9f8e into session-foundation:release/1.21.0 Mar 4, 2025
@mpretty-cyro mpretty-cyro deleted the feature/libsession-logging branch March 4, 2025 21:27
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