| Conditions | 1 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import json |
||
| 14 | def format(self, record): |
||
| 15 | |||
| 16 | event_dict = { |
||
| 17 | 'timestamp': datetime.utcfromtimestamp(record.created), |
||
| 18 | 'event_id': uuid.uuid4(), |
||
| 19 | "name": record.name, |
||
| 20 | "level": record.levelname, |
||
| 21 | "message": record.msg, |
||
| 22 | 'pid': record.process, |
||
| 23 | 'thread': record.thread, |
||
| 24 | 'sourceFilePath': record.pathname, |
||
| 25 | 'module': record.module, |
||
| 26 | 'functionName': record.funcName, |
||
| 27 | 'lineNumber': record.lineno |
||
| 28 | } |
||
| 29 | |||
| 30 | return json.dumps(event_dict, default=json_serializer) |
||
| 31 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.