#well...
1 messages · Page 1 of 1 (latest)
yes... well... like i can do with UE_LOGFMT
i personally havent looked into UE_LOGFMT
somewhere ages ago i found a list of better logging macros
#define TRACE_LOG_PRINTF(LogCat, FormatString , ...) UE_LOG(LogCat,Log,TEXT("%s: %s"), *TRACE_STR_CUR_CLASS_FUNC_LINE, *FString::Printf(TEXT(FormatString), ##__VA_ARGS__ ) )
looks like this
in code you would do:
TRACE_LOG_PRINTF(yourlogcategory,"My test string %s", *myteststringvariable)
is that not clear/readable enough for you?
then i could just go with FString::Printf
jeah
i mean you could try to use the fmt lib as external lib (https://github.com/fmtlib/fmt) but i doubt its worth the hassle
yes, not worth it
then u can do stuff like this print("You clicked {button} at {x},{y}.", arg("button", "b1"), arg("x", 50), arg("y", 30));
so your concern is just about readability if i understood correctly?
well if you have some specific patterns which reoccour you could also just make a macro for that^^
i just thought since Epic added the nice UE_LOGFMT, they may have also done something similar for Printf, but seems they did not
I suspect what you could to is dive into the definitions of UE_LOGFMT and see if you can duplicate if for the Printf. The only downside would be that you than have to use macros for printf as well
is there any include needed for UE_LOGFMT? just tried it myself but could not find it at v5.4.2
Edit: Nevermind found it