Logs 'msg % args' at level 'level' only if condition is fulfilled.

def log_if(level, msg, condition, *args):
  """Logs 'msg % args' at level 'level' only if condition is fulfilled."""
  if condition:
    log(level, msg, *args)