Skip to content

log: Details in error messages #16206

@maflcko

Description

@maflcko

Error messages generally consist of a reason that explains what happened. However some of them contain more details such as the function name. This is problematic when the function name changes and the reason string is unique enough to find the exact line in the source code based on the debug log.

Most error messages are already unique and we should probably not put the function name (or similar) in them and instead make sure that they don't change otherwise.

If for some reason it is helpful to include the function name (or line number, file name, ...), it should probably go at the end of the log message in braces. E.g. LogPrintf("Init failed due to coding error (DEBUG: Init(), init.cpp:1234)");.

Not sure about that, so opening a brainstorming issue.

See also:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions