So I found out that log
offers an optional argument named target
for specifying the string which only defaults to the module name of the caller.
I assume that this is done using the builtin module_path
macro provided by the compiler.
This works for log
but I don't think it could work for getting the path for a Location
as I would need.
Because now I don't think there is a better solution when not using a macro (what I don't want because of the calling syntax) I will use the file path with line number for this argument.
Feel free to let me know if there is a more elegant solution!