Passing formatted string to a macro
hello, I want to be able to write my own logs like this :
and here is my macro:
i added the "..." and "##VA_ARGS" because i received error that my macro has too many arguments. the text that gets logged is "Item named %s has spawned" (not formatted with the value) is there a way to pass a formatted string to the macro? i.e.
or even make it work like in the first line of code above?
Well.... i didnt find the solution i was hoping for, but for anyone trying to figure out how to save formatted string into variables, i ended up using this:
answered Nov 01 '18 at 05:39 PM
You can actually see exactly what unreal's log macro is doing in LogMacros.h. You could take that code and do some string manipulation of Format inside your macro to preprend the extra info you want before moving ahead with the rest of the normal logging functionality.
answered Oct 30 '18 at 07:11 PMBrian Johnstone (suspended)
Follow this question
Once you sign in you will be able to subscribe for any updates here