#well...

1 messages · Page 1 of 1 (latest)

wise nova
#

So you would like to do named formatting as you can do it in python for example?

ember mural
wise nova
#

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?

ember mural
#

then i could just go with FString::Printf

ember mural
wise nova
wise nova
#

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?

ember mural
#

mostly, yes

#

its not a big issue

wise nova
#

well if you have some specific patterns which reoccour you could also just make a macro for that^^

ember mural
#

i just thought since Epic added the nice UE_LOGFMT, they may have also done something similar for Printf, but seems they did not

wise nova
#

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