refactor print log