Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[native] Ensure function_name() is part of log message#10302

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@jonpryor
Copy link
Contributor

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 thelog_fatal() invocation withinmono-log-adapter.cc to use{} instead of%s, in accordance with C++std::format. This should causesloc.function_name() to be properly part of the abort message.

Context:dotnet/runtime#117733When a .NET for Android app aborts, the abort message should containthe file name, line number, column, and function name of the functionwhich 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 theabort message.
@jonathanpeppers
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link

CopilotAI 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 fixes a formatting issue in native logging code where function names were not being properly displayed in abort messages. Instead of showing the actual function name, abort messages were displaying the literal string%s.

  • Updates the log format string to use C++std::format syntax with{} instead of%s
  • Ensures thatsloc.function_name() is properly included in abort messages for better debugging

log_fatal (
category,
"Abort at {}:{}:{} ('%s')",
"Abort at {}:{}:{} ('{}')",

Choose a reason for hiding this comment

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

The format string has been updated to use{} for the function name, but there's no corresponding argument being passed for this placeholder. The diff shows the format string change but doesn't show the function_name argument being added to the log_fatal call.

Copilot uses AI. Check for mistakes.

Choose a reason for hiding this comment

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

I seestd.function_name:

log_fatal (
category,
"Abort at {}:{}:{} ('{}')",
file_name,
sloc.line (),
sloc.column (),
sloc.function_name ()
);

Because this is on multiple lines, I bet the AI didn't actually see the full method...

Copy link
Member

@jonathanpeppersjonathanpeppers left a comment

Choose a reason for hiding this comment

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

The test failures are due to coming from a fork:

'InstallAndroidDependenciesTestGoogleV2' requires a commercial build of .NET for Android.

We probably want those to just ignore instead of fail.

@jonathanpeppersjonathanpeppers merged commitfa23828 intodotnet:mainJul 17, 2025
54 of 59 checks passed
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 17, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

Copilot code reviewCopilotCopilot left review comments

@jonathanpeppersjonathanpeppersjonathanpeppers approved these changes

@grendellogrendelloAwaiting requested review from grendellogrendello is a code owner

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@jonpryor@jonathanpeppers

[8]ページ先頭

©2009-2025 Movatter.jp