Skip to content

log::warn() and log::err() print wrong file and line in terminal output #2180

Description

@RubenAune

Describe the bug
Using the C++ API for functions log::warn() and log::err() prints the __FILE__ and __LINE__ values of where their C++ interfaces are implemented, not where they are actually called from. E.g. log::err() always prints "flecs.h: 23953:", because that's where ecs_logv(-3, fmt, args) is called.

The C interface works as expected.

To Reproduce
Use C++ functions log::warn() and log::err()

Expected behavior
log::warn() and log::err() should exhibit identical behaviour to ecs_warn() and ecs_err(), and correctly print __FILE__ and __LINE__ of the original caller.

Additional context
Using Xcode on MacOS
-std=C++20
-std=GNU99

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions