Code refactor for log line printing.