Skip to content

Commit fa23828

Browse files
authored
[native] Ensure function_name() is part of log message (#10302)
Context: dotnet/runtime#117733 When a .NET for Android app aborts, the abort message should contain the file name, line number, column, and function name of the function which triggered the abort. Insteda, we get the filename, line number, and column, but we get `%s` for the function name: F monodroid: Abort at mono-log-adapter.cc:46:3 ('%s') Update the `log_fatal()` invocation within `mono-log-adapter.cc` to use `{}` instead of `%s`, in accordance with C++ `std::format`. This should cause `sloc.function_name()` to be properly part of the abort message.
1 parent fdbb7f8 commit fa23828

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/native/mono/shared/helpers.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Helpers::abort_application (LogCategories category, const char *message, bool lo
3535

3636
log_fatal (
3737
category,
38-
"Abort at {}:{}:{} ('%s')",
38+
"Abort at {}:{}:{} ('{}')",
3939
file_name,
4040
sloc.line (),
4141
sloc.column (),

0 commit comments

Comments
 (0)