Python Logging Format Function In R