Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def log_record(record_type, data=None, verbose=True, **data_args):
"""Create records with the given data & type"""
global _data_blocks
# Create the combined data dictionary
data = _parse_data(data, data_args)
if data is None and verbose:
log('Nothing to record. Skipping..', error=True)
return
# Send to API endpoint
res = api.post_block(data, record_type)
tracking_slug = res['tracking']['trackingSlug']
# Save to data block
_data_blocks.append((tracking_slug, record_type, data))
if verbose:
log(record_type.capitalize() + ' logged.')