Skip to content

Commit e17cafd

Browse files
committed
Refactored Log class and DashboardLogger class
1 parent 078113e commit e17cafd

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed
File renamed without changes.

src/classes/Log.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
class Log:
2+
def __init__(self, LogID: str, JobID: str, LogDate: str, Status: str, Message: str):
3+
self.LogID = LogID
4+
self.JobID = JobID
5+
self.LogDate = LogDate
6+
self.Status = Status
7+
self.Message = Message
8+
9+
def toJson(self):
10+
return {
11+
"LogID": self.LogID,
12+
"JobID": self.JobID,
13+
"LogDate": self.LogDate,
14+
"Status": self.Status,
15+
"Message": self.Message
16+
}
17+
18+
def __dict__(self):
19+
return self.toJson()

src/dashboard.py

+2-21
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
'''
3030
Classes Import
3131
'''
32-
from DashboardLogger import DashboardLogger
32+
from classes.DashboardLogger import DashboardLogger
33+
from classes.Log import Log
3334

3435
DASHBOARD_VERSION = 'v4.1.1'
3536
CONFIGURATION_PATH = os.getenv('CONFIGURATION_PATH', '.')
@@ -80,26 +81,6 @@ def default(self, o):
8081

8182

8283
app.json = CustomJsonEncoder(app)
83-
84-
class Log:
85-
def __init__(self, LogID: str, JobID: str, LogDate: str, Status: str, Message: str):
86-
self.LogID = LogID
87-
self.JobID = JobID
88-
self.LogDate = LogDate
89-
self.Status = Status
90-
self.Message = Message
91-
92-
def toJson(self):
93-
return {
94-
"LogID": self.LogID,
95-
"JobID": self.JobID,
96-
"LogDate": self.LogDate,
97-
"Status": self.Status,
98-
"Message": self.Message
99-
}
100-
101-
def __dict__(self):
102-
return self.toJson()
10384

10485
class PeerJobLogger:
10586
def __init__(self):

0 commit comments

Comments
 (0)