added  write_log function

The write_log() function dries out the logging functionality in get_socrata_data() function