mapping each function of $log to the base functionality, refactoring, using regexp for matching any placeholder.