python: create append format log format string function