code: def write_log_file(namespace, document):
      
      log_timestamp = asctime(gmtime(document[TS]))
      with open("{}{}.{}.log".format(LOG_DIR, namespace, DAY_STRING), "a") as f:
          log_string = dumps({
              "datetime": log_timestamp.upper(),
              "namespace": namespace,
              "log": document[LOG_KEY]
          })
          f.write("{}\n".format(log_string))
docs: Writes a line to a log file
      
      Arguments:
          namespace {str} -- namespace of document
          document {dict} -- document to write to the logs