Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
Add time logging
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondw2 committed Oct 31, 2021
1 parent b455518 commit 32b33d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions d8error.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os.path
import csv
import ipywidgets as widgets
import datetime

class Announce:
"""error index, serves as an id on the csv file"""
Expand Down Expand Up @@ -33,13 +34,14 @@ def __init__(self, etype, value):

def writeRow(file):
"""saves errors to errorLog.csv"""
fieldnames = ['index', 'errorType', 'errorMSG', 'feedbackRating', 'feedbackMSG']
fieldnames = ['index', 'errorType', 'errorMSG', 'feedbackRating', 'feedbackMSG', "Time"]
writer = csv.DictWriter(file, fieldnames=fieldnames)
writer.writerow({"index": self.eindex,
"errorType": self.errorname,
"errorMSG": str(self.value),
"feedbackRating": self.feedbackRating,
"feedbackMSG": self.feedbackMSG})
"feedbackMSG": self.feedbackMSG,
"Time": str(datetime.datetime.now())})

if not os.path.isfile("errorLog.csv"):
with open('errorLog.csv', 'w', newline='') as f:
Expand Down

0 comments on commit 32b33d5

Please sign in to comment.