Skip to content

Conversation

grendello
Copy link
Contributor

Logging to logcat in Android is expensive and unpredictable in
terms of how much time it takes exactly. Therefore, we try to
log as little as possible by default, reducing the delays.

This PR removes (or demotes to a lower priority) a number of log
messages that were useful during testing and development, but are
an unnecessary noise for day-to-day app operation.

@grendello grendello requested a review from Copilot June 25, 2025 10:13
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reduces logging overhead and noise by removing or demoting various log messages across native and managed code, as well as updating the directory creation call.

  • Removed or downgraded log messages in Android system initialization and host modules.
  • Switched from direct mkdir calls to a call to create_directory for public directory creation.
  • Removed redundant logs in the managed TypeManager.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/native/clr/runtime-base/util.cc Updated to use create_directory instead of mkdir.
src/native/clr/include/runtime-base/android-system.hh Demoted log_warn to log_debug for directory creation.
src/native/clr/host/host.cc Removed log message on Host OnLoad.
src/native/clr/host/host-jni.cc Removed log message in JNI_OnLoad.
src/native/clr/host/assembly-store.cc Demoted a log_warn to log_debug with inline comment.
src/Mono.Android/Java.Interop/TypeManager.cs Removed log output for loaded type.
Comments suppressed due to low confidence (1)

src/native/clr/runtime-base/util.cc:55

  • Confirm that create_directory replicates the error handling behavior of mkdir; if there are any differences, consider adding an inline comment to clarify the change.
	int ret = create_directory (dir.data (), 0777);

@grendello
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

I somehow reviewed the wrong PR, but I think I had the same comments about the logging here:

@grendello
Copy link
Contributor Author

Heh, yeah, the other one has this one's commits cherry-picked :)

@grendello
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

This looks good, the CI failures we can ignore: InstallAndroidDependenciesTest("GoogleV2")
(working to fix in other PRs)

And this one: GuavaListenableFuture: System.Net.WebException : The operation has timed out.

@grendello grendello merged commit f4e3b2f into main Jun 26, 2025
54 of 59 checks passed
@grendello grendello deleted the dev/grendel/clr-host-less-logging branch June 26, 2025 16:38
@github-actions github-actions bot locked and limited conversation to collaborators Jul 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants