Log only if there is a logger