refactor log display code (ID-243)