php: formated log string function