Skip to content

Commit

Permalink
Merge pull request #63 from kiendang/return-event
Browse files Browse the repository at this point in the history
Return event after emitting
  • Loading branch information
yuvipanda committed May 6, 2021
2 parents 6f1933c + 2381271 commit e053682
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions jupyter_telemetry/eventlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,22 @@ def get_allowed_categories(self, schema_name):
def record_event(self, schema_name, version, event, timestamp_override=None):
"""
Record given event with schema has occurred.
Parameters
----------
schema_name: str
Name of the schema
version: str
The schema version
event: dict
The event to record
timestamp_override: datetime, optional
Optionally override the event timestamp. By default it is set to the current timestamp.
Returns
-------
dict
The recorded event data
"""
if not (self.handlers and schema_name in self.allowed_schemas):
# if handler isn't set up or schema is not explicitly whitelisted,
Expand Down Expand Up @@ -245,3 +261,4 @@ def record_event(self, schema_name, version, event, timestamp_override=None):
capsule[property_name] = None

self.log.info(capsule)
return capsule

0 comments on commit e053682

Please sign in to comment.