Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Documentation/workflow/SystemProperties.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ Configures native .NET for Android runtime logging. The value is a
comma-separated list of `NAME[=VALUE]` categories:

* `all` enables all categories.
* `assembly` logs assembly lookup and loading.
* `assembly` logs assembly lookup and loading, including unsuccessful probes.
These diagnostics are disabled by default; `default` alone does not enable them.
Warnings about actual I/O failures and runtime errors remain visible without
opting in.
* `default` enables general runtime messages.
* `gc` logs garbage-collection messages.
* `network` logs native network activity.
Expand All @@ -67,6 +70,9 @@ Example:
adb shell setprop debug.dotnet.log default,assembly
```

To enable only assembly-loading diagnostics, set
`adb shell setprop debug.dotnet.log assembly` and restart the application.

## debug.dotnet.max_grefc

Overrides the maximum number of JNI global references. The default is `2000`
Expand Down
2 changes: 1 addition & 1 deletion src/native/clr/host/assembly-store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ auto AssemblyStore::open_assembly (std::string_view const& name, int64_t &size)
const AssemblyStoreIndexEntry *hash_entry = find_assembly_store_entry (name, name_hash, assembly_store_hashes, assembly_store.index_entry_count);
if (hash_entry == nullptr) [[unlikely]] {
size = 0;
log_warnf (LOG_ASSEMBLY, "Assembly '%.*s' (hash 0x%x) not found", static_cast<int>(name.length ()), name.data (), name_hash);
log_debugf (LOG_ASSEMBLY, "Assembly '%.*s' (hash 0x%x) not found", static_cast<int>(name.length ()), name.data (), name_hash);
return nullptr;
}

Expand Down
5 changes: 2 additions & 3 deletions src/native/clr/host/fastdev-assemblies.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ auto FastDevAssemblies::open_assembly (std::string_view const& name, int64_t &si
);

if (!Util::file_exists (override_dir_fd, name)) {
log_warnf (LOG_ASSEMBLY, "FastDev assembly '%.*s' not found.", static_cast<int>(name.length ()), name.data ());
log_debugf (LOG_ASSEMBLY, "FastDev assembly '%.*s' not found.", static_cast<int>(name.length ()), name.data ());
return nullptr;
}
log_debugf (LOG_ASSEMBLY, "Found FastDev assembly '%.*s'", static_cast<int>(name.length ()), name.data ());
Expand Down Expand Up @@ -259,9 +259,8 @@ auto FastDevAssemblies::build_tpa_list () noexcept -> char*
// CoreCLR's `.r2r.dll` probes aren't compatible with our TPA path.
if (count > 0 && found_corelib && !found_r2r) {
tpa_in_use = true;
log_writef (
log_infof (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 ⚠️ Testing — This category-filtered call means the FastDev: Found ... message is absent unless debug.dotnet.log includes assembly, but InstallAndRunTests.StackTraceContainsLineNumbers still unconditionally asserts that this message and the following explanation are present without enabling that category. Please update that test to opt in (and restore the property afterward), or remove those unrelated log assertions, so the test remains consistent with the new contract.

Rule: Keep behavioral tests aligned with intentional output changes

LOG_ASSEMBLY,
LogLevel::Info,
"FastDev: Found %zu assemblies in '%s'. Loading assemblies from disk is normal during Fast Deployment.",
count,
override_dir_path
Expand Down
2 changes: 1 addition & 1 deletion src/native/clr/host/host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void Host::clr_error_writer (const char *message) noexcept
bool Host::clr_external_assembly_probe (const char *path, void **data_start, int64_t *size) noexcept
{
// TODO: `path` might be a full path, make sure it isn't
log_debugf (LOG_DEFAULT, "clr_external_assembly_probe (\"%s\"...)", optional_string (path));
log_debugf (LOG_ASSEMBLY, "clr_external_assembly_probe (\"%s\"...)", optional_string (path));
if (data_start == nullptr || size == nullptr) {
return false; // TODO: abort instead?
}
Expand Down
Loading