Conditions | 2 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | from datetime import datetime |
||
36 | def to_string_dict(self): |
||
37 | """ |
||
38 | Makes a dictionary which has all keys and values as strings and |
||
39 | contains all the data that the LogMessage has. |
||
40 | |||
41 | :return: Dictionary with keys and values as string. |
||
42 | """ |
||
43 | retval = {} |
||
44 | |||
45 | retval["message"] = str(self.message) |
||
46 | retval["timestamp"] = ("" if self.timestamp == None |
||
47 | else self.timestamp.isoformat()) |
||
48 | retval["log_level"] = str(LOG_LEVEL.reverse.get(self.log_level, "")) |
||
49 | |||
50 | return retval |
||
51 |