Logging Printf Logs on a text file and on Console.
I suggest using semihosting to display printf output in debugger console, for further information on semihosting see my post here
To retarget debugger console output to a file, you have to check “File” checkbox and choose a file from Debug Configuration > Common (TAB)
Best Regards,
Tarek