Fixed #5805: refactor cc.log for more maintainability

Refactor cc.log for more maintainability