log.BaseEncoder: change to use a buffer instead of concatenating strings

Signed-off-by: Alejandro Mery <amery@geeks.cl>