log: fix AddBackend() issue when backend is nil

log: refactor golog printing code, use an independent object

Change-Id: I3fbd79f6565951ac455f6508edfe09d0746cea48