Skip to content

Commit

Permalink
adding timestamps for logs (gradio-app#238)
Browse files Browse the repository at this point in the history
Co-authored-by: Ali Abid <[email protected]>
  • Loading branch information
harjyotbagga and testaliabid authored Jul 9, 2021
1 parent a7ddbe0 commit dd27ff0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gradio/networking.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import threading
import pkg_resources
from distutils import dir_util
import datetime
import time
import json
import urllib.request
Expand Down Expand Up @@ -296,6 +297,7 @@ def flag_data(input_data, output_data, flag_option=None, flag_index=None, userna
csv_data.append(flag_option)
if username is not None:
csv_data.append(username)
csv_data.append(str(datetime.datetime.now()))
if is_new:
headers = [interface["label"]
for interface in app.interface.config["input_components"]]
Expand All @@ -305,6 +307,7 @@ def flag_data(input_data, output_data, flag_option=None, flag_index=None, userna
headers.append("flag")
if username is not None:
headers.append("username")
headers.append("timestamp")

def replace_flag_at_index(file_content):
file_content = io.StringIO(file_content)
Expand Down

0 comments on commit dd27ff0

Please sign in to comment.