code: def equals_log_diff(expected, actual, level=logging.ERROR):
    
    if expected == actual:
      return True
  
    # Output the diff first.
    logging.log(level, '***** Data mismatch: *****')
    for line in difflib.unified_diff(
        expected.splitlines(), actual.splitlines(),
        fromfile='expected', tofile='actual', lineterm=''):
      logging.log(level, line)
    logging.log(level, '^^^^^  Data diff  ^^^^^')
docs: Compare two string blobs, error log diff if they don't match.