will gives me 3 lines and I want 1.
So just remove the '\n' from the resulting string, or replace it with a space or what ever other charachter just before you want to log it.