a piece of simple log code