Skip to content

Commit e2a4fb8

Browse files
committed
Less assembly logging
Context: https://developercommunity.visualstudio.com/content/problem/1021788/javainterop-assembly-not-found-for-xamarin-android.html Turn some warnings about typemap not finding entries to info-level messages, not visible by default.
1 parent f3bf582 commit e2a4fb8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/monodroid/jni/embedded-assemblies.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ EmbeddedAssemblies::typemap_java_to_managed (const char *java_type_name)
204204
}
205205

206206
if (XA_UNLIKELY (entry == nullptr)) {
207-
log_warn (LOG_ASSEMBLY, "typemap: unable to find mapping to a managed type from Java type '%s'", java_type_name);
207+
log_info (LOG_ASSEMBLY, "typemap: unable to find mapping to a managed type from Java type '%s'", java_type_name);
208208
return nullptr;
209209
}
210210

@@ -236,7 +236,7 @@ EmbeddedAssemblies::typemap_java_to_managed (const char *java_type_name)
236236
TypeMapModule *module;
237237
const TypeMapJava *java_entry = binary_search<const char, TypeMapJava, compare_java_name, true> (java_type_name, map_java, java_type_count, java_name_width);
238238
if (java_entry == nullptr) {
239-
log_warn (LOG_ASSEMBLY, "typemap: unable to find mapping to a managed type from Java type '%s'", java_type_name);
239+
log_info (LOG_ASSEMBLY, "typemap: unable to find mapping to a managed type from Java type '%s'", java_type_name);
240240
return nullptr;
241241
}
242242

@@ -248,7 +248,7 @@ EmbeddedAssemblies::typemap_java_to_managed (const char *java_type_name)
248248
module = const_cast<TypeMapModule*>(&map_modules[java_entry->module_index]);
249249
const TypeMapModuleEntry *entry = binary_search <uint32_t, TypeMapModuleEntry, compare_type_token> (&java_entry->type_token_id, module->map, module->entry_count);
250250
if (entry == nullptr) {
251-
log_warn (LOG_ASSEMBLY, "typemap: unable to find mapping from Java type '%s' to managed type with token ID %u in module [%s]", java_type_name, java_entry->type_token_id, MonoGuidString (module->module_uuid).get ());
251+
log_info (LOG_ASSEMBLY, "typemap: unable to find mapping from Java type '%s' to managed type with token ID %u in module [%s]", java_type_name, java_entry->type_token_id, MonoGuidString (module->module_uuid).get ());
252252
return nullptr;
253253
}
254254
uint32_t type_token_id = java_entry->type_token_id;
@@ -373,13 +373,13 @@ EmbeddedAssemblies::typemap_managed_to_java ([[maybe_unused]] MonoType *type, Mo
373373
entry = typemap_managed_to_java (full_name);
374374

375375
if (XA_UNLIKELY (entry == nullptr)) {
376-
log_warn (LOG_ASSEMBLY, error_message, full_name);
376+
log_info (LOG_ASSEMBLY, error_message, full_name);
377377
}
378378
} else {
379379
simple_pointer_guard<char> full_name = utils.string_concat (type_name.get (), ", ", image_name);
380380
entry = typemap_managed_to_java (full_name.get ());
381381
if (XA_UNLIKELY (entry == nullptr)) {
382-
log_warn (LOG_ASSEMBLY, error_message, full_name.get ());
382+
log_info (LOG_ASSEMBLY, error_message, full_name.get ());
383383
}
384384
}
385385

@@ -446,7 +446,7 @@ EmbeddedAssemblies::typemap_managed_to_java ([[maybe_unused]] MonoType *type, Mo
446446
}
447447

448448
if (entry == nullptr) {
449-
log_warn (LOG_ASSEMBLY, "typemap: type with token %d (0x%x) in module {%s} (%s) not found.", token, token, MonoGuidString (mvid).get (), match->assembly_name);
449+
log_info (LOG_ASSEMBLY, "typemap: type with token %d (0x%x) in module {%s} (%s) not found.", token, token, MonoGuidString (mvid).get (), match->assembly_name);
450450
return nullptr;
451451
}
452452
}
@@ -491,7 +491,7 @@ EmbeddedAssemblies::typemap_managed_to_java (MonoReflectionType *reflection_type
491491

492492
MonoType *type = mono_reflection_type_get_type (reflection_type);
493493
if (type == nullptr) {
494-
log_warn (LOG_DEFAULT, "Failed to map reflection type to MonoType");
494+
log_warn (LOG_ASSEMBLY, "Failed to map reflection type to MonoType");
495495
return nullptr;
496496
}
497497

@@ -806,7 +806,7 @@ EmbeddedAssemblies::try_load_typemaps_from_directory (const char *path)
806806
simple_pointer_guard<char[]> dir_path (utils.path_combine (path, "typemaps"));
807807
monodroid_dir_t *dir;
808808
if ((dir = utils.monodroid_opendir (dir_path)) == nullptr) {
809-
log_warn (LOG_DEFAULT, "typemap: could not open directory: `%s`", dir_path.get ());
809+
log_warn (LOG_ASSEMBLY, "typemap: could not open directory: `%s`", dir_path.get ());
810810
return;
811811
}
812812

0 commit comments

Comments
 (0)