def METHOD_NAME(filename, data):
    filename = os.path.join(log.log_dir, filename)
    if not isinstance(data, bytes):
        data = data.encode("utf-8")
    with open(filename, "wb") as f:
        f.write(data)